コード例 #1
0
ファイル: test__DataProxy.py プロジェクト: bjlittle/iris-grib
 def test_bitmap__invalid_indicator(self):
     section_6 = {'bitMapIndicator': 100, 'bitmap': None}
     data_proxy = _DataProxy(0, 0, 0, 0)
     with self.assertRaisesRegexp(TranslationError, 'unsupported bitmap'):
         data_proxy._bitmap(section_6)
コード例 #2
0
ファイル: test__DataProxy.py プロジェクト: bjlittle/iris-grib
 def test_bitmap_present(self):
     bitmap = randint(2, size=(12))
     section_6 = {'bitMapIndicator': 0, 'bitmap': bitmap}
     data_proxy = _DataProxy(0, 0, 0, 0)
     result = data_proxy._bitmap(section_6)
     self.assertArrayEqual(bitmap, result)
コード例 #3
0
ファイル: test__DataProxy.py プロジェクト: bjlittle/iris-grib
 def test_no_bitmap(self):
     section_6 = {'bitMapIndicator': 255, 'bitmap': None}
     data_proxy = _DataProxy(0, 0, 0, 0)
     result = data_proxy._bitmap(section_6)
     self.assertIsNone(result)
コード例 #4
0
 def test_bitmap__invalid_indicator(self):
     section_6 = {'bitMapIndicator': 100, 'bitmap': None}
     data_proxy = _DataProxy(0, 0, 0, 0)
     with self.assertRaisesRegexp(TranslationError, 'unsupported bitmap'):
         data_proxy._bitmap(section_6)
コード例 #5
0
 def test_bitmap_present(self):
     bitmap = randint(2, size=(12))
     section_6 = {'bitMapIndicator': 0, 'bitmap': bitmap}
     data_proxy = _DataProxy(0, 0, 0, 0)
     result = data_proxy._bitmap(section_6)
     self.assertArrayEqual(bitmap, result)
コード例 #6
0
 def test_no_bitmap(self):
     section_6 = {'bitMapIndicator': 255, 'bitmap': None}
     data_proxy = _DataProxy(0, 0, 0, 0)
     result = data_proxy._bitmap(section_6)
     self.assertIsNone(result)