예제 #1
0
 def test_handle_mxnet_error_index_fail(self):
     # Assert original error is raised when a ValueError is raised because string indexing fails
     with open('tests/data/exceptions/model_architecture_error_fail.txt', 'r') as tf:
         string = tf.read()
     error = CustomError(string)
     with self.assertRaises(CustomError):
         exceptions._handle_mxnet_error(error)
예제 #2
0
 def test_handle_mxnet_error_random_string(self):
     # Assert original error is raised when string does not match expected error string because error not related to
     # weight shape mismatch
     string = 'cvbcbcbvb'
     error = CustomError(string)
     with self.assertRaises(CustomError):
         exceptions._handle_mxnet_error(error)
예제 #3
0
 def test_handle_mxnet_error(self):
     # Assert ModelArchitectureError is raised
     with open('tests/data/exceptions/model_architecture_error.txt', 'r') as tf:
         string = tf.read()
     error = CustomError(string)
     with self.assertRaises(exceptions.ModelArchitectureError):
         exceptions._handle_mxnet_error(error)