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
0b964257
Commit
0b964257
authored
Aug 22, 2013
by
William Tisäter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve test coverage
parent
9bec82b1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
tests/test_region.py
+20
-0
No files found.
tests/test_region.py
View file @
0b964257
...
...
@@ -7,6 +7,18 @@ from tests.config import REGION_DB_PATH
class
TestGeoIPRegionFunctions
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
se_hostname
=
'dn.se'
self
.
se_region_data
=
{
'region_code'
:
None
,
'country_code'
:
None
}
self
.
ca_hostname
=
'cbc.ca'
self
.
ca_region_data
=
{
'region_code'
:
'ON'
,
'country_code'
:
'CA'
}
self
.
us_code
=
'US'
self
.
us_hostname
=
'apple.com'
self
.
us_ip
=
'17.172.224.47'
...
...
@@ -32,3 +44,11 @@ class TestGeoIPRegionFunctions(unittest.TestCase):
def
testCountryCodeByAddr
(
self
):
us_code
=
self
.
gir
.
country_code_by_addr
(
self
.
us_ip
)
self
.
assertEqual
(
us_code
,
self
.
us_code
)
def
testCanadaRegion
(
self
):
region_name
=
self
.
gir
.
region_by_name
(
self
.
ca_hostname
)
self
.
assertEqual
(
region_name
,
self
.
ca_region_data
)
def
testSwedenRegion
(
self
):
region_name
=
self
.
gir
.
region_by_name
(
self
.
se_hostname
)
self
.
assertEqual
(
region_name
,
self
.
se_region_data
)
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