Esempio n. 1
0
 def test_error(self):
     # Test what happens when we call:
     #   ProtoCube.register(cube, error_on_mismatch=True)
     proto_cube = ProtoCube(self.cube1)
     if self.fragments:
         with self.assertRaises(iris.exceptions.MergeError) as cm:
             proto_cube.register(self.cube2, error_on_mismatch=True)
         error_message = str(cm.exception)
         for substr in self.fragments:
             self.assertIn(substr, error_message)
     else:
         result = proto_cube.register(self.cube2, error_on_mismatch=True)
         self.assertTrue(result)
Esempio n. 2
0
 def test_error(self):
     # Test what happens when we call:
     #   ProtoCube.register(cube, error_on_mismatch=True)
     proto_cube = ProtoCube(self.cube1)
     if self.fragments:
         with self.assertRaises(iris.exceptions.MergeError) as cm:
             proto_cube.register(self.cube2, error_on_mismatch=True)
         error_message = str(cm.exception)
         for substr in self.fragments:
             self.assertIn(substr, error_message)
     else:
         result = proto_cube.register(self.cube2, error_on_mismatch=True)
         self.assertTrue(result)
Esempio n. 3
0
 def test_no_error(self):
     # Test what happens when we call:
     #   ProtoCube.register(cube, error_on_mismatch=False)
     proto_cube = ProtoCube(self.cube1)
     result = proto_cube.register(self.cube2, error_on_mismatch=False)
     self.assertEqual(result, not self.fragments)
Esempio n. 4
0
 def test_default(self):
     # Test what happens when we call:
     #   ProtoCube.register(cube)
     proto_cube = ProtoCube(self.cube1)
     result = proto_cube.register(self.cube2)
     self.assertEqual(result, not self.fragments)
Esempio n. 5
0
 def test_no_error(self):
     # Test what happens when we call:
     #   ProtoCube.register(cube, error_on_mismatch=False)
     proto_cube = ProtoCube(self.cube1)
     result = proto_cube.register(self.cube2, error_on_mismatch=False)
     self.assertEqual(result, not self.fragments)
Esempio n. 6
0
 def test_default(self):
     # Test what happens when we call:
     #   ProtoCube.register(cube)
     proto_cube = ProtoCube(self.cube1)
     result = proto_cube.register(self.cube2)
     self.assertEqual(result, not self.fragments)