Skip to content

Commit

Permalink
Updated unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
minhtuevo committed Jan 6, 2025
1 parent a6a0ba8 commit fbead8e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tests/unittests/operators/registry_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,14 @@ def test_list_operator_type_operators(self):
self.assertEqual(len(operators), 2)

def test_list_invalid_type_raises_error(self):
with self.assertRaises(ValueError):
self.registry.list_operators(type="invalid")
for operator_type in ["invalid", "", 1]:
with self.assertRaises(ValueError):
self.registry.list_operators(type=operator_type)

def test_list_operators_empty_contexts(self):
with patch(
'fiftyone.plugins.context.build_plugin_contexts') as mock_build:
mock_build.return_value = []
registry = OperatorRegistry()
operators = registry.list_operators()
self.assertEqual(len(operators), 0)

0 comments on commit fbead8e

Please sign in to comment.