示例#1
0
 def test_to_netcdf(self):
     citycatio.to_netcdf(self.folder,
                         self.netcdf_path,
                         srid=27700,
                         attributes={'key': 'value'})
     ds = nc.Dataset(self.netcdf_path)
     self.assertIsNotNone(ds)
     self.assertIsNotNone(ds.variables['crs'])
     self.assertEqual(ds.key, 'value')
     ds.close()
示例#2
0
 def test_to_netcdf_attribute_value_types(self):
     with self.assertRaises(AssertionError):
         citycatio.to_netcdf(self.folder,
                             self.netcdf_path,
                             attributes={'key': [datetime.datetime.now()]})
示例#3
0
 def test_to_netcdf_attribute_names_are_alphanumeric(self):
     with self.assertRaises(AssertionError):
         citycatio.to_netcdf(self.folder,
                             self.netcdf_path,
                             attributes={'key*': 'value'})
示例#4
0
 def test_to_netcdf_attribute_names_start_with_letter(self):
     with self.assertRaises(AssertionError):
         citycatio.to_netcdf(self.folder,
                             self.netcdf_path,
                             attributes={'1key': 'value'})