class TestSo(unittest.TestCase): """Tests for so fixes.""" def setUp(self): """Prepare tests.""" self.cube = Cube([1.0, 2.0], var_name='so', units='1.0') self.fix = So() def test_get(self): """Test fix get""" self.assertListEqual(Fix.get_fixes('CMIP5', 'CCSM4', 'so'), [So()]) def test_fix_metadata(self): """Checks that units are changed to the correct value.""" cube = self.fix.fix_metadata([self.cube])[0] self.assertEqual('1e3', cube.units.origin)
def test_get(self): """Test fix get.""" self.assertListEqual(Fix.get_fixes('CMIP5', 'CCSM4', 'Amon', 'so'), [So(self.vardef)])
def setUp(self): """Prepare tests.""" self.cube = Cube([1.0, 2.0], var_name='so', units='1.0') self.vardef = get_var_info('CMIP5', 'Omon', self.cube.var_name) self.fix = So(self.vardef)
def setUp(self): """Prepare tests.""" self.cube = Cube([1.0, 2.0], var_name='so', units='1.0') self.fix = So()