Commit a5dac674 by William Tisäter

Add tests for const tuple lengths and continents

parent 85d0c92f
......@@ -357,7 +357,7 @@ COUNTRY_NAMES = (
'Saint Martin', 'Bonaire, Sint Eustatius and Saba', 'South Sudan'
)
CONTINENT_NAMES = {
CONTINENT_NAMES = (
'--', 'AS', 'EU', 'EU', 'AS', 'AS', 'NA', 'NA', 'EU', 'AS', 'NA', 'AF',
'AN', 'SA', 'OC', 'EU', 'OC', 'NA', 'AS', 'EU', 'NA', 'AS', 'EU', 'AF',
'EU', 'AS', 'AF', 'AF', 'NA', 'AS', 'SA', 'SA', 'NA', 'AS', 'AN', 'AF',
......@@ -380,7 +380,7 @@ CONTINENT_NAMES = {
'EU', 'NA', 'SA', 'NA', 'NA', 'AS', 'OC', 'OC', 'OC', 'AS', 'AF', 'EU',
'AF', 'AF', 'EU', 'AF', '--', '--', '--', 'EU', 'EU', 'EU', 'EU', 'NA',
'NA', 'NA', 'AF'
}
)
# storage / caching flags
STANDARD = 0
......
# -*- coding: utf-8 -*-
import unittest
from pygeoip import const
class TestSanity(unittest.TestCase):
def testConstLengths(self):
assert len(const.COUNTRY_CODES) == len(const.COUNTRY_CODES3)
assert len(const.COUNTRY_CODES) == len(const.COUNTRY_NAMES)
assert len(const.COUNTRY_CODES) == len(const.CONTINENT_NAMES)
......@@ -30,6 +30,7 @@ class TestGeoIPCityFunctions(unittest.TestCase):
'dma_code': 807,
'country_code': 'US',
'country_name': 'United States',
'continent': 'NA',
'time_zone': 'America/Los_Angeles'
}
......@@ -44,6 +45,7 @@ class TestGeoIPCityFunctions(unittest.TestCase):
'dma_code': 0,
'country_code': 'GB',
'country_name': 'United Kingdom',
'continent': 'EU',
'time_zone': 'Europe/London'
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment