def test_multiple_cubes_no_transform(self): target = ConcreteReferenceTarget('foo') src = stock.realistic_4d() for i in range(src.shape[0]): target.add_cube(src[i]) dest = target.as_cube() self.assertIsNot(dest, src) self.assertEqual(dest, src)
def test_multiple_cubes_no_transform(self): target = ConcreteReferenceTarget("foo") src = stock.realistic_4d() for i in range(src.shape[0]): target.add_cube(src[i]) dest = target.as_cube() self.assertIsNot(dest, src) self.assertEqual(dest, src)
def test_single_cube_with_transform(self): transform = lambda cube: {'long_name': 'wibble'} target = ConcreteReferenceTarget('foo', transform) src = stock.simple_2d() target.add_cube(src) dest = target.as_cube() self.assertEqual(dest.long_name, 'wibble') self.assertNotEqual(dest, src) dest.long_name = src.long_name self.assertEqual(dest, src)
def test_multiple_cubes_with_transform(self): transform = lambda cube: {'long_name': 'wibble'} target = ConcreteReferenceTarget('foo', transform) src = stock.realistic_4d() for i in range(src.shape[0]): target.add_cube(src[i]) dest = target.as_cube() self.assertEqual(dest.long_name, 'wibble') self.assertNotEqual(dest, src) dest.long_name = src.long_name self.assertEqual(dest, src)
def test_single_cube_with_transform(self): def transform(cube): return {"long_name": "wibble"} target = ConcreteReferenceTarget("foo", transform) src = stock.simple_2d() target.add_cube(src) dest = target.as_cube() self.assertEqual(dest.long_name, "wibble") self.assertNotEqual(dest, src) dest.long_name = src.long_name self.assertEqual(dest, src)
def test_multiple_cubes_with_transform(self): def transform(cube): return {"long_name": "wibble"} target = ConcreteReferenceTarget("foo", transform) src = stock.realistic_4d() for i in range(src.shape[0]): target.add_cube(src[i]) dest = target.as_cube() self.assertEqual(dest.long_name, "wibble") self.assertNotEqual(dest, src) dest.long_name = src.long_name self.assertEqual(dest, src)
def test_single_cube_no_transform(self): target = ConcreteReferenceTarget("foo") src = stock.simple_2d() target.add_cube(src) self.assertIs(target.as_cube(), src)
def test_single_cube_no_transform(self): target = ConcreteReferenceTarget('foo') src = stock.simple_2d() target.add_cube(src) self.assertIs(target.as_cube(), src)