示例#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)
示例#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)
示例#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)
示例#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)
示例#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)
示例#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)