Skip to content

Commit

Permalink
test ls: _restrict_row
Browse files Browse the repository at this point in the history
  • Loading branch information
asmacdo committed Feb 3, 2025
1 parent 7df236c commit 937e33d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/test_ls.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import json
from unittest.mock import mock_open, patch
from con_duct.suite.ls import _flatten_dict, load_duct_runs
from con_duct.suite.ls import _flatten_dict, _restrict_row, load_duct_runs


def test_load_duct_runs_sanity():
Expand Down Expand Up @@ -43,3 +43,12 @@ def test_flatten_dict():
nested = {"a": {"b": 1, "c": 2}, "d": 3}
result = _flatten_dict(nested)
assert result == {"b": 1, "c": 2, "d": 3}


def test_restrict_row():
row = {"prefix": "/test/path", "exit_code": 0, "extra": "ignore"}
fields = ["exit_code"]
result = _restrict_row(fields, row)
assert "prefix" in result
assert "exit_code" in result
assert "extra" not in result

0 comments on commit 937e33d

Please sign in to comment.