diff options
author | 2017-07-05 10:19:17 -0700 | |
---|---|---|
committer | 2017-07-05 10:28:57 -0700 | |
commit | 472cd28c5c35b9a31bc78750e61317eabb05d2b1 (patch) | |
tree | 9549dd34528b4fbb333a5908ae6b3b8054012165 /tensorflow/python/tools/saved_model_cli_test.py | |
parent | d8cd3775215d09acb8ef997fe7045f1bc592f2d2 (diff) |
Better error handling when given input key is not valid for saved_model_cli.
PiperOrigin-RevId: 160972434
Diffstat (limited to 'tensorflow/python/tools/saved_model_cli_test.py')
-rw-r--r-- | tensorflow/python/tools/saved_model_cli_test.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tensorflow/python/tools/saved_model_cli_test.py b/tensorflow/python/tools/saved_model_cli_test.py index 8f79c888eb..a55cf168b2 100644 --- a/tensorflow/python/tools/saved_model_cli_test.py +++ b/tensorflow/python/tools/saved_model_cli_test.py @@ -391,6 +391,16 @@ Method name is: tensorflow/serving/predict""" y_expected = np.array([[2.5], [3.0]]) self.assertAllClose(y_expected, y_actual) + def testRunCommandInvalidInputKeyError(self): + self.parser = saved_model_cli.create_parser() + base_path = test.test_src_dir_path(SAVED_MODEL_PATH) + args = self.parser.parse_args([ + 'run', '--dir', base_path, '--tag_set', 'serve', '--signature_def', + 'regress_x2_to_y3', '--input_exprs', 'x2=np.ones((3,1))' + ]) + with self.assertRaises(ValueError): + saved_model_cli.run(args) + def testRunCommandOutputFileExistError(self): self.parser = saved_model_cli.create_parser() base_path = test.test_src_dir_path(SAVED_MODEL_PATH) |