Skip to content

Commit

Permalink
extended provincie tests to improve coverage refs #31
Browse files Browse the repository at this point in the history
  • Loading branch information
TalissaJoly committed Sep 3, 2014
1 parent fbcf3ab commit 9741de1
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions crabpy/tests/gateway/test_crab.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@ def test_list_gemeenten_Vlaanderen(self):
self.assertEqual(res[0].gewest.id, 2)

def test_list_provincies(self):
gewest = Gewest(1)
res = self.crab.list_provincies(gewest)
self.assertIsInstance(res, list)
gewest = Gewest(3)
res = self.crab.list_provincies(gewest)
self.assertIsInstance(res, list)
gewest = Gewest(2)
res = self.crab.list_provincies(gewest)
self.assertIsInstance(res, list)
Expand All @@ -97,6 +103,33 @@ def test_get_provincie_by_id(self):
res = self.crab.get_provincie_by_id(10000)
self.assertIsInstance(res, Provincie)
self.assertEqual(res.niscode, 10000)
res = self.crab.get_provincie_by_id(20001)
self.assertIsInstance(res, Provincie)
self.assertEqual(res.niscode, 20001)
res = self.crab.get_provincie_by_id(20002)
self.assertIsInstance(res, Provincie)
self.assertEqual(res.niscode, 20002)
res = self.crab.get_provincie_by_id(30000)
self.assertIsInstance(res, Provincie)
self.assertEqual(res.niscode, 30000)
res = self.crab.get_provincie_by_id(40000)
self.assertIsInstance(res, Provincie)
self.assertEqual(res.niscode, 40000)
res = self.crab.get_provincie_by_id(50000)
self.assertIsInstance(res, Provincie)
self.assertEqual(res.niscode, 50000)
res = self.crab.get_provincie_by_id(60000)
self.assertIsInstance(res, Provincie)
self.assertEqual(res.niscode, 60000)
res = self.crab.get_provincie_by_id(70000)
self.assertIsInstance(res, Provincie)
self.assertEqual(res.niscode, 70000)
res = self.crab.get_provincie_by_id(80000)
self.assertIsInstance(res, Provincie)
self.assertEqual(res.niscode, 80000)
res = self.crab.get_provincie_by_id(90000)
self.assertIsInstance(res, Provincie)
self.assertEqual(res.niscode, 90000)

def test_list_gemeenten_by_provincie(self):
provincie = Provincie(10000, 'Antwerpen', 2)
Expand Down

0 comments on commit 9741de1

Please sign in to comment.