tests package

Submodules

tests.test_extractor module

class tests.test_extractor.TestExtractor(methodName='runTest')[source]

Bases: unittest.case.TestCase

test Extractor

check(places, expectedList)[source]

check the places for begin non empty and having at least the expected List of elements

Parameters:
  • places (Places) – the places to check
  • expectedList (list) – the list of elements to check
setUp()[source]

Hook method for setting up the test fixture before exercising it.

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

testExtractorFromText()[source]

test different texts for getting geo context information

testExtractorFromUrl()[source]

test the extractor

testGeograpyIssue32()[source]

test https://github.com/ushahidi/geograpy/issues/32

testGetGeoPlace()[source]

test geo place handling

testIssue10()[source]

test https://github.com/somnathrakshit/geograpy3/issues/10 Add ISO country code

testIssue7()[source]

test https://github.com/somnathrakshit/geograpy3/issues/7 disambiguating countries

testIssue9()[source]

test https://github.com/somnathrakshit/geograpy3/issues/9 [BUG]AttributeError: ‘NoneType’ object has no attribute ‘name’ on “Pristina, Kosovo”

testStackOverflow54721435()[source]

see https://stackoverflow.com/questions/54721435/unable-to-extract-city-names-from-a-text-using-geograpypython

testStackoverflow43322567()[source]

see https://stackoverflow.com/questions/43322567

testStackoverflow54077973()[source]

see https://stackoverflow.com/questions/54077973/geograpy3-library-for-extracting-the-locations-in-the-text-gives-unicodedecodee

testStackoverflow54712198()[source]

see https://stackoverflow.com/questions/54712198/not-only-extracting-places-from-a-text-but-also-other-names-in-geograpypython

testStackoverflow55548116()[source]

see https://stackoverflow.com/questions/55548116/geograpy3-library-is-not-working-properly-and-give-traceback-error

testStackoverflow62152428()[source]

see https://stackoverflow.com/questions/62152428/extracting-country-information-from-description-using-geograpy?noredirect=1#comment112899776_62152428

tests.test_locator module

Created on 2020-09-19

@author: wf

class tests.test_locator.TestLocator(methodName='runTest')[source]

Bases: unittest.case.TestCase

test the Locator class from the location module

checkExamples(examples, countries, debug=False, check=True)[source]

check that the given example give results in the given countries :param examples: a list of example location strings :type examples: list :param countries: a list of expected country iso codes :type countries: list

setUp()[source]

Hook method for setting up the test fixture before exercising it.

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

testDelimiters()[source]

test the delimiter statistics for names

testExamples()[source]

test examples

testGeolite2Cities()[source]

test the locs.db cache for cities

testHasData()[source]

check has data and populate functionality

testIsoRegexp()[source]

test regular expression for iso codes

testIssue15()[source]

https://github.com/somnathrakshit/geograpy3/issues/15 test Issue 15 Disambiguate via population, gdp data

testIssue17()[source]

test issue 17:

https://github.com/somnathrakshit/geograpy3/issues/17

[BUG] San Francisco, USA and Auckland, New Zealand should be locatable #17

testIssue19()[source]

test issue 19

testIssue22()[source]

https://github.com/somnathrakshit/geograpy3/issues/22

testPopulation()[source]

test adding population data from wikidata to GeoLite2 information

testWordCount()[source]

test the word count

tests.test_places module

class tests.test_places.TestPlaces(methodName='runTest')[source]

Bases: unittest.case.TestCase

test Places

setUp()[source]

Hook method for setting up the test fixture before exercising it.

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

testPlaces()[source]

test places

tests.test_prefixtree module

tests.test_wikidata module

Created on 2020-09-23

@author: wf

class tests.test_wikidata.TestWikidata(methodName='runTest')[source]

Bases: unittest.case.TestCase

test the wikidata access for cities

setUp()[source]

Hook method for setting up the test fixture before exercising it.

tearDown()[source]

Hook method for deconstructing the test fixture after testing it.

testLocatorWithWikiData()[source]

test Locator

testWikidataCities()[source]
test getting city information from wikidata

1372 Singapore 749 Beijing, China 704 Paris, France 649 Barcelona, Spain 625 Rome, Italy 616 Hong Kong 575 Bangkok, Thailand 502 Vienna, Austria 497 Athens, Greece 483 Shanghai, China

testWikidataCountries()[source]

test getting country information from wikidata

Module contents