Skip to content

Commit 682f839

Browse files
committed
refactor(tests): remove overengineered tests from test suite for improved clarity
1 parent 280d176 commit 682f839

4 files changed

Lines changed: 0 additions & 165 deletions

File tree

BaseAgent/tests/test_nodes.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,6 @@
1616
class TestRouting:
1717
"""Tests for routing_function()."""
1818

19-
def test_routes_execute(self):
20-
executor = NodeExecutor(make_agent())
21-
state = make_state()
22-
state["next_step"] = "execute"
23-
assert executor.routing_function(state) == "execute"
24-
25-
def test_routes_generate(self):
26-
executor = NodeExecutor(make_agent())
27-
state = make_state()
28-
state["next_step"] = "generate"
29-
assert executor.routing_function(state) == "generate"
30-
31-
def test_routes_end(self):
32-
executor = NodeExecutor(make_agent())
33-
state = make_state()
34-
state["next_step"] = "end"
35-
assert executor.routing_function(state) == "end"
36-
3719
def test_raises_on_unknown(self):
3820
executor = NodeExecutor(make_agent())
3921
state = make_state()
@@ -45,16 +27,6 @@ def test_raises_on_unknown(self):
4527
class TestRoutingSelfCritic:
4628
"""Tests for routing_function_self_critic()."""
4729

48-
def test_generate(self):
49-
executor = NodeExecutor(make_agent())
50-
state = {"next_step": "generate"}
51-
assert executor.routing_function_self_critic(state) == "generate"
52-
53-
def test_end(self):
54-
executor = NodeExecutor(make_agent())
55-
state = {"next_step": "end"}
56-
assert executor.routing_function_self_critic(state) == "end"
57-
5830
def test_raises_on_unknown(self):
5931
executor = NodeExecutor(make_agent())
6032
state = {"next_step": "bad"}

BaseAgent/tests/test_repl_isolation.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@ def test_global_namespace_unchanged_when_ns_provided(self):
4040
run_python_repl("_isolation_probe = 'hello'", namespace=ns)
4141
assert "_isolation_probe" not in _persistent_namespace
4242

43-
def test_global_namespace_used_when_none(self, clear_repl_namespace):
44-
run_python_repl("_global_test_var = 99")
45-
assert _persistent_namespace.get("_global_test_var") == 99
46-
4743
def test_variables_persist_across_calls_in_same_namespace(self):
4844
ns = {}
4945
run_python_repl("counter = 0", namespace=ns)
@@ -117,10 +113,6 @@ def test_global_namespace_unchanged_when_ns_provided(self):
117113
inject_custom_functions_to_repl({"_probe_fn": lambda: None}, namespace=ns)
118114
assert "_probe_fn" not in _persistent_namespace
119115

120-
def test_inject_into_global_when_namespace_none(self, clear_repl_namespace):
121-
inject_custom_functions_to_repl({"_global_fn": lambda: 42})
122-
assert "_global_fn" in _persistent_namespace
123-
124116
def test_empty_functions_dict_is_noop(self):
125117
ns = {}
126118
inject_custom_functions_to_repl({}, namespace=ns)

BaseAgent/tests/test_resource_manager.py

Lines changed: 0 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -96,28 +96,6 @@ def test_add_tool_ignores_existing_id(self):
9696
rm.add_tool(t)
9797
assert t.id == 0
9898

99-
def test_get_tool_by_name_found(self):
100-
rm = ResourceManager()
101-
rm.add_tool(make_tool("search_tool"))
102-
tool = rm.get_tool_by_name("search_tool")
103-
assert tool is not None
104-
assert tool.name == "search_tool"
105-
106-
def test_get_tool_by_name_not_found(self):
107-
rm = ResourceManager()
108-
assert rm.get_tool_by_name("ghost") is None
109-
110-
def test_find_tool_by_id_found(self):
111-
rm = ResourceManager()
112-
rm.add_tool(make_tool("my_func"))
113-
tool = rm.find_tool_by_id(0)
114-
assert tool is not None
115-
assert tool.name == "my_func"
116-
117-
def test_find_tool_by_id_not_found(self):
118-
rm = ResourceManager()
119-
assert rm.find_tool_by_id(999) is None
120-
12199
def test_get_tool_id_by_name(self):
122100
rm = ResourceManager()
123101
rm.add_tool(make_tool("alpha"))
@@ -129,10 +107,6 @@ def test_get_tool_name_by_id(self):
129107
rm.add_tool(make_tool("gamma"))
130108
assert rm.get_tool_name_by_id(0) == "gamma"
131109

132-
def test_get_tool_name_by_id_not_found(self):
133-
rm = ResourceManager()
134-
assert rm.get_tool_name_by_id(42) is None
135-
136110
def test_list_all_tools(self):
137111
rm = ResourceManager()
138112
rm.add_tool(make_tool("t1"))
@@ -149,21 +123,13 @@ def test_remove_tool_by_id_success(self):
149123
assert removed is True
150124
assert rm.get_tool_by_name("removeme") is None
151125

152-
def test_remove_tool_by_id_not_found(self):
153-
rm = ResourceManager()
154-
assert rm.remove_tool_by_id(999) is False
155-
156126
def test_remove_tool_by_name_success(self):
157127
rm = ResourceManager()
158128
rm.add_tool(make_tool("byname"))
159129
removed = rm.remove_tool_by_name("byname")
160130
assert removed is True
161131
assert rm.get_tool_by_name("byname") is None
162132

163-
def test_remove_tool_by_name_not_found(self):
164-
rm = ResourceManager()
165-
assert rm.remove_tool_by_name("ghost") is False
166-
167133
def test_filter_tools_by_module(self):
168134
rm = ResourceManager()
169135
rm.add_tool(make_tool("a", module="pkg.utils"))
@@ -197,40 +163,13 @@ def test_load_tools_bulk(self):
197163

198164
class TestDataManagement:
199165

200-
def test_add_data_item(self):
201-
rm = ResourceManager()
202-
rm.add_data_item(make_data("proteins.parquet", "parquet"))
203-
assert len(rm.collection.data_lake) == 1
204-
205-
def test_add_custom_data(self):
206-
rm = ResourceManager()
207-
rm.add_custom_data(make_custom_data("exp.csv"))
208-
assert len(rm.collection.custom_data) == 1
209-
210166
def test_get_all_data_combines_both(self):
211167
rm = ResourceManager()
212168
rm.add_data_item(make_data("lake.tsv", "tsv"))
213169
rm.add_custom_data(make_custom_data("custom.csv"))
214170
all_data = rm.get_all_data()
215171
assert len(all_data) == 2
216172

217-
def test_find_data_by_filename_data_lake(self):
218-
rm = ResourceManager()
219-
rm.add_data_item(make_data("binding.tsv"))
220-
item = rm.find_data_by_filename("binding.tsv")
221-
assert item is not None
222-
assert item.filename == "binding.tsv"
223-
224-
def test_find_data_by_filename_custom_data(self):
225-
rm = ResourceManager()
226-
rm.add_custom_data(make_custom_data("myexp.csv"))
227-
item = rm.find_data_by_filename("myexp.csv")
228-
assert item is not None
229-
230-
def test_find_data_by_filename_not_found(self):
231-
rm = ResourceManager()
232-
assert rm.find_data_by_filename("missing.csv") is None
233-
234173
def test_filter_data_by_category(self):
235174
rm = ResourceManager()
236175
rm.add_data_item(make_data("a.csv", category="genomics"))
@@ -266,33 +205,12 @@ def test_load_data_items_bulk(self):
266205

267206
class TestLibraryManagement:
268207

269-
def test_add_library(self):
270-
rm = ResourceManager()
271-
rm.add_library(make_library("pandas"))
272-
assert len(rm.collection.libraries) == 1
273-
274-
def test_add_custom_software(self):
275-
rm = ResourceManager()
276-
rm.add_custom_software(make_custom_software("blast"))
277-
assert len(rm.collection.custom_software) == 1
278-
279208
def test_get_all_libraries_combines_both(self):
280209
rm = ResourceManager()
281210
rm.add_library(make_library("biopython"))
282211
rm.add_custom_software(make_custom_software("blast"))
283212
assert len(rm.get_all_libraries()) == 2
284213

285-
def test_find_library_by_name(self):
286-
rm = ResourceManager()
287-
rm.add_library(make_library("scipy"))
288-
lib = rm.find_library_by_name("scipy")
289-
assert lib is not None
290-
assert lib.name == "scipy"
291-
292-
def test_find_library_by_name_not_found(self):
293-
rm = ResourceManager()
294-
assert rm.find_library_by_name("ghost") is None
295-
296214
def test_filter_libraries_by_type(self):
297215
rm = ResourceManager()
298216
rm.add_library(make_library("numpy", "Python"))

BaseAgent/tests/test_skills.py

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -48,44 +48,6 @@ def write_skill_file(path: Path, frontmatter: str, body: str = "## Instructions\
4848
# ==============================================================================
4949

5050
class TestSkillModel:
51-
def test_required_fields(self):
52-
skill = Skill(name="my-skill", description="does stuff")
53-
assert skill.name == "my-skill"
54-
assert skill.description == "does stuff"
55-
56-
def test_defaults(self):
57-
skill = make_skill()
58-
assert skill.tools == []
59-
assert skill.instructions == "## Instructions\nDo the thing."
60-
assert skill.source_path is None
61-
assert skill.source_dir is None
62-
assert skill.selected is True
63-
64-
def test_tools_list(self):
65-
skill = make_skill(tools=["run_python_repl", "read_function_source_code"])
66-
assert "run_python_repl" in skill.tools
67-
68-
def test_missing_name_raises(self):
69-
with pytest.raises(Exception):
70-
Skill(description="no name")
71-
72-
def test_missing_description_raises(self):
73-
with pytest.raises(Exception):
74-
Skill(name="no-desc")
75-
76-
def test_selected_flag(self):
77-
skill = make_skill(selected=False)
78-
assert skill.selected is False
79-
80-
def test_resource_collection_has_skills(self):
81-
rc = ResourceCollection()
82-
assert hasattr(rc, "skills")
83-
assert rc.skills == []
84-
85-
def test_source_dir_default(self):
86-
skill = make_skill()
87-
assert skill.source_dir is None
88-
8951
def test_has_bundled_resources_no_source_dir(self):
9052
skill = make_skill()
9153
assert skill.has_bundled_resources is False
@@ -123,27 +85,18 @@ def test_add_skill(self):
12385
assert len(self.rm.get_all_skills()) == 1
12486
assert self.rm.get_all_skills()[0].name == "alpha"
12587

126-
def test_get_all_skills_empty(self):
127-
assert self.rm.get_all_skills() == []
128-
12988
def test_get_skill_by_name(self):
13089
skill = make_skill(name="beta")
13190
self.rm.add_skill(skill)
13291
found = self.rm.get_skill_by_name("beta")
13392
assert found is not None
13493
assert found.name == "beta"
13594

136-
def test_get_skill_by_name_missing(self):
137-
assert self.rm.get_skill_by_name("nope") is None
138-
13995
def test_remove_skill_by_name(self):
14096
self.rm.add_skill(make_skill(name="gamma"))
14197
assert self.rm.remove_skill_by_name("gamma") is True
14298
assert self.rm.get_skill_by_name("gamma") is None
14399

144-
def test_remove_skill_by_name_missing(self):
145-
assert self.rm.remove_skill_by_name("nope") is False
146-
147100
def test_get_selected_skills(self):
148101
self.rm.add_skill(make_skill(name="s1", selected=True))
149102
self.rm.add_skill(make_skill(name="s2", selected=False))

0 commit comments

Comments
 (0)