tests package

Submodules

tests.test_extractor module

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

Bases: tests.basetest.Geograpy3Test

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
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: tests.basetest.Geograpy3Test

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

checkExpected(lod, expected)[source]
lookupQuery(viewName, whereClause)[source]
testCityLookup()[source]

test the cityLookup to city/region/country object cluster

testCountryLookup()[source]

test country Lookup

testDelimiters()[source]

test the delimiter statistics for names

testExamples()[source]

test examples

testGetCountry()[source]

test getting a country by name or ISO

testHasViews()[source]

test that the views are available

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

testIssue41_CountriesFromErdem()[source]

test getting Country list from Erdem

testIssue_42_distance()[source]

test haversine and location

testIssue_59_db_download()[source]

tests the correct downloading of the backup database in different configurations

testProceedingsExample()[source]

test a proceedings title Example

testRegionLookup()[source]

test region Lookup

testStackOverflow64379688()[source]

compare old and new geograpy interface

testStackOverflow64418919()[source]

https://stackoverflow.com/questions/64418919/problem-retrieving-region-in-us-with-geograpy3

testUML()[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: tests.basetest.Geograpy3Test

test Places

setUp()[source]

setUp test environment

testGetRegionNames()[source]

test getting region names

testIssue25()[source]

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

testIssue49()[source]

country recognition

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: tests.basetest.Geograpy3Test

test the wikidata access for cities

testGetCoordinateComponents()[source]

test the splitting of coordinate components in WikiData query results

testGetWikidataId()[source]

test getting a wikiDataId from a given URL

testWikidataCities()[source]

test getting city information from wikidata

testWikidataCityStates()[source]

test getting region information from wikidata

testWikidataCountries()[source]

test getting country information from wikidata

testWikidataRegions()[source]

test getting region information from wikidata

Module contents