<commit_before># -*- coding: UTF-8 -*-
from geopy.geocoders import Teleport
from test.geocoders.util import GeocoderTestBase


class TeleportTestCaseUnitTest(GeocoderTestBase):

    def test_user_agent_custom(self):
        geocoder = Teleport(
            user_agent='my_user_agent/1.0'
        )
        self.assertEqual(geocoder.headers['User-Agent'], 'my_user_agent/1.0')


class TeleportTestCase(GeocoderTestBase):

    @classmethod
    def setUpClass(cls):
        cls.delta = 0.04

    def test_unicode_name(self):
        """
        Teleport.geocode unicode
        """
        # work around ConfigurationError raised in GeoNames init
        self.geocoder = Teleport()
        self.geocode_run(
            {"query": "New York, NY"},
            {"latitude": 40.71427, "longitude": -74.00597},
        )

    def test_reverse(self):
        """
        Teleport.reverse
        """
        # work around ConfigurationError raised in GeoNames init
        self.geocoder = Teleport()
        self.reverse_run(
            {"query": "40.71427, -74.00597"},
            {"latitude": 40.71427, "longitude": -74.00597,
             "address": "New York City, New York, United States"},
        )<commit_msg>Use http scheme to reduce test times<commit_after># -*- coding: UTF-8 -*-
from geopy.geocoders import Teleport
from test.geocoders.util import GeocoderTestBase


class TeleportTestCaseUnitTest(GeocoderTestBase):

    def test_user_agent_custom(self):
        geocoder = Teleport(
            user_agent='my_user_agent/1.0'
        )
        self.assertEqual(geocoder.headers['User-Agent'], 'my_user_agent/1.0')


class TeleportTestCase(GeocoderTestBase):

    @classmethod
    def setUpClass(cls):
        cls.delta = 0.04

    def test_unicode_name(self):
        """
        Teleport.geocode unicode
        """
        # work around ConfigurationError raised in GeoNames init
        self.geocoder = Teleport(scheme='http')
        self.geocode_run(
            {"query": "New York, NY"},
            {"latitude": 40.71427, "longitude": -74.00597},
        )

    def test_reverse(self):
        """
        Teleport.reverse
        """
        # work around ConfigurationError raised in GeoNames init
        self.geocoder = Teleport(scheme='http')
        self.reverse_run(
            {"query": "40.71427, -74.00597"},
            {"latitude": 40.71427, "longitude": -74.00597,
             "address": "New York City, New York, United States"},
        )
{'fraction_non_alphanumeric': 0.11898016997167139, 'fraction_numerical': 0.04046944556859571, 'mean_word_length': 2.327052489905787, 'pattern_counts': {'":': 14, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1177297', 'n_tokens_mistral': 825, 'n_tokens_neox': 745, 'n_words': 160}