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
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)