Updated the 'test_create_from_options_fails_with_invalid_model_path' test case

This commit is contained in:
kinaryml 2022-11-08 11:26:02 -08:00
parent 647b94240d
commit 77cc4c53ab

View File

@ -135,10 +135,9 @@ class HandLandmarkerTest(parameterized.TestCase):
def test_create_from_options_fails_with_invalid_model_path(self):
# Invalid empty model path.
with self.assertRaisesRegex(
ValueError,
r"ExternalFile must specify at least one of 'file_content', "
r"'file_name', 'file_pointer_meta' or 'file_descriptor_meta'."):
base_options = _BaseOptions(model_asset_path='')
RuntimeError, 'Unable to open file at /path/to/invalid/model.tflite'):
base_options = _BaseOptions(
model_asset_path='/path/to/invalid/model.tflite')
options = _HandLandmarkerOptions(base_options=base_options)
_HandLandmarker.create_from_options(options)