예제 #1
0
 def test_register(self):
     category, key, value = "backbone_class", "test_key", 0
     REGISTRY.register(category=category, name=key, cls=value)
     assert REGISTRY._dict[(category, key)] == value
     assert REGISTRY.get(category, key) == value
예제 #2
0
 def test_register_err(self, category, key, err_msg):
     with pytest.raises(ValueError) as err_info:
         REGISTRY.register(category=category, name=key, cls=0)
     assert err_msg in str(err_info.value)