Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pygeoip
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
pygeoip
Commits
a5dac674
Commit
a5dac674
authored
Feb 23, 2013
by
William Tisäter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for const tuple lengths and continents
parent
85d0c92f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
2 deletions
+14
-2
pygeoip/const.py
+2
-2
tests/test.py
+10
-0
tests/test_city.py
+2
-0
No files found.
pygeoip/const.py
View file @
a5dac674
...
...
@@ -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
...
...
tests/test.py
0 → 100644
View file @
a5dac674
# -*- 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
)
tests/test_city.py
View file @
a5dac674
...
...
@@ -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'
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment