agentos-project/agentos

fix registry tests to not hard code values because that's fragile

Opened this issue · 0 comments

andyk commented

See, e.g.,

def test_flatten_versioned_spec():
reg = Registry.from_yaml(GH_SB3_AGENT_DIR / "components.yaml")
rand_comp_spec = reg.get_component_spec("agent", "test_staging")
assert "agent==test_staging" in rand_comp_spec.keys()
assert rand_comp_spec["agent==test_staging"]["repo"] == "aos_github"
flattened = flatten_spec(rand_comp_spec)
assert flattened["identifier"] == "agent==test_staging"
assert flattened["name"] == "agent"
assert flattened["version"] == "test_staging"

Instead of hard coding strings in our assert statements like "agent==test_staging", "agent", and "test_staging", we should read the yaml file directly and compare the results of

YAML -> registry object -> API to get spec value from Registry 

TO

loading values from the YAML file directly.