Skip to content

Commit 9ea1509

Browse files
ppavlidisclaude
andcommitted
test: check expected columns by name instead of strict shape[1] == 5
``test_get_dataset_annotations`` asserted ``res.shape[1] == 5`` against the gemma-rest ``/datasets/{id}/annotations`` response. gemmapy commit ``fb7afb8`` ("add evidence code to annotation processing") added ``evidence_code`` to the DataFrame projection but didn't update this test, so the assertion has been one column behind (now 6 cols, asserts == 5). Replace the bare shape[1] check with an expected-column-name subset assertion. Verifies the columns we care about are present without breaking the next time gemma-rest emits an additive field, which is the contract direction (server-side additive fields are backwards-compatible for clients that don't strict-check column counts. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> EOF )
1 parent a966c0b commit 9ea1509

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

tests/test_basic.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,14 @@ def test_search_annotations():
104104
def test_get_dataset_annotations():
105105
res = api.get_dataset_annotations(1)
106106
assert type(res) is pd.core.frame.DataFrame
107-
assert res.shape[1] == 5
107+
# Expected columns. evidence_code was added in fb7afb8 ("add evidence
108+
# code to annotation processing") but the test's bare shape[1] == 5
109+
# assertion wasn't updated, so it failed once gemma-rest started
110+
# emitting evidenceCode. Check by name instead of count so future
111+
# additive fields don't break this test the same way.
112+
expected = {"class_name", "class_URI", "term_name", "term_URI",
113+
"object_class", "evidence_code"}
114+
assert expected.issubset(set(res.columns))
108115

109116
def test_get_dataset_differential_expression_analyses():
110117
res = api.get_dataset_differential_expression_analyses(200)

0 commit comments

Comments
 (0)