Skip to content

Commit 7efbbc3

Browse files
authored
Merge pull request #75 from CCPBioSim/74-yaml-input-bug
Fix YAML input for top_traj_file:
2 parents 0b96f22 + 25e58b8 commit 7efbbc3

File tree

2 files changed

+4
-18
lines changed

2 files changed

+4
-18
lines changed

CodeEntropy/config/arg_config_manager.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
"type": str,
1313
"nargs": "+",
1414
"help": "Path to Structure/topology file followed by Trajectory file(s)",
15-
"default": [],
1615
},
1716
"selection_string": {
1817
"type": str,

tests/test_EntropyFunctions/test_main_mcc.py

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -213,25 +213,12 @@ def test_default_values(self, mock_parse_args):
213213
Test if argument parser assigns default values correctly.
214214
"""
215215
arg_config = ConfigManager()
216-
217-
# Ensure every argument gets a sensible default
218-
default_args = {
219-
arg: params.get("default", False if "action" in params else None)
220-
for arg, params in arg_config.arg_map.items()
221-
}
222-
223-
# Mock argparse to return expected defaults
224-
mock_parse_args.return_value = MagicMock(**default_args)
225-
216+
mock_parse_args.return_value = MagicMock(
217+
top_traj_file=["example.top", "example.traj"]
218+
)
226219
parser = arg_config.setup_argparse()
227220
args = parser.parse_args()
228-
229-
# Compare parsed args with expected defaults
230-
for arg, params in arg_config.arg_map.items():
231-
expected_default = params.get(
232-
"default", False if "action" in params else None
233-
)
234-
self.assertEqual(getattr(args, arg), expected_default)
221+
self.assertEqual(args.top_traj_file, ["example.top", "example.traj"])
235222

236223
@patch(
237224
"argparse.ArgumentParser.parse_args", return_value=MagicMock(top_traj_file=None)

0 commit comments

Comments
 (0)