Skip to content

Commit

Permalink
#91 NA-50 added Domain test in case _create_extentDic
Browse files Browse the repository at this point in the history
  • Loading branch information
jeong1park committed Jan 15, 2018
1 parent 3fcdddc commit 4137859
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions nansat/tests/test_domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,37 @@ def test_get_geolocation_grids(self):
self.assertEqual(type(lat), np.ndarray)
self.assertEqual(lat.shape, (500, 500))

def test_dont_create_extentDic_from_invalid_combination(self):
d = Domain(4326, "-te 25 70 35 72 -ts 500 500")
with self.assertRaises(OptionError):
d._create_extentDic("-ts 500 500 -tr 500 500")
with self.assertRaises(OptionError):
d._create_extentDic("-te 25 70 35 72 -lle 25 70 35 72")

def test_dont_create_extentDic_from_invalid_tr(self):
d = Domain(4326, "-te 25 70 35 72 -ts 500 500")
with self.assertRaises(OptionError):
d._create_extentDic("-te 25 70 35 72 -tr 500 ")
with self.assertRaises(OptionError):
d._create_extentDic("-te 25 70 35 72 -tr 500 -")

def test_dont_create_extentDic_from_invalid_ts(self):
d = Domain(4326, "-te 25 70 35 72 -ts 500 500")
with self.assertRaises(OptionError):
d._create_extentDic("-te 25 70 35 72 -ts 500 ")
with self.assertRaises(OptionError):
d._create_extentDic("-te 25 70 35 72 -ts 500 -")

def test_dont_create_extentDic_from_invalid_te(self):
d = Domain(4326, "-te 25 70 35 72 -ts 500 500")
with self.assertRaises(OptionError):
d._create_extentDic("-te 25 70 35 -tr 500 500")

def test_dont_create_extentDic_from_invalid_lle(self):
d = Domain(4326, "-te 25 70 35 72 -ts 500 500")
with self.assertRaises(OptionError):
d._create_extentDic("-lle 25 70 35 -tr 500 500")

def test_get_border(self):
d = Domain(4326, "-te 25 70 35 72 -ts 500 500")
lon, lat = d.get_border()
Expand Down

0 comments on commit 4137859

Please sign in to comment.