Ejemplo n.º 1
0
 def test_register(self):
     category, key, value = "backbone_class", "test_key", 0
     registry = Registry()
     registry.register(category, key, value)
     assert registry._dict[(category, key)] == value
Ejemplo n.º 2
0
 def test_get(self):
     category, key, value = "backbone_class", "test_key", 0
     registry = Registry()
     registry.register(category, key, value)
     assert registry.get(category, key) == value
Ejemplo n.º 3
0
 def test_register_err(self, category, key, err_msg):
     registry = Registry()
     with pytest.raises(ValueError) as err_info:
         registry.register(category, key, 0)
     assert err_msg in str(err_info.value)