Skip to content

Commit

Permalink
fix: lists should be sorted before assertion
Browse files Browse the repository at this point in the history
Signed-off-by: George Vauter <[email protected]>
  • Loading branch information
gvauter committed Aug 20, 2024
1 parent 8c08bd6 commit f5752f5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/trestlebot/entrypoints/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,15 @@ def test_init_ssp_github(
# directories for ssp model should exist
model_dirs = [d.name for d in tmp_dir.iterdir() if not is_hidden(d)]
expected = InitEntrypoint.MODEL_DIRS[args_dict["oscal-model"]]
assert model_dirs == expected
assert sorted(model_dirs) == sorted(expected)

# directories for github workflows should exist
workflow_dir = tmp_dir.joinpath(".github/workflows")
workflow_files = [f.name for f in workflow_dir.iterdir()]
expected = InitEntrypoint.PROVIDER_TEMPLATES[args_dict["provider"]][
args_dict["oscal-model"]
]
assert workflow_files == expected
assert sorted(workflow_files) == sorted(expected)

assert any(
record.levelno == logging.INFO
Expand Down Expand Up @@ -145,15 +145,15 @@ def test_init_compdef_github(
tmp_dir = pathlib.Path(tmp_init_dir)
model_dirs = [d.name for d in tmp_dir.iterdir() if not is_hidden(d)]
expected = InitEntrypoint.MODEL_DIRS[args_dict["oscal-model"]]
assert model_dirs == expected
assert sorted(model_dirs) == sorted(expected)

# directories for github workflows should exist
workflow_dir = tmp_dir.joinpath(".github/workflows")
workflow_files = [f.name for f in workflow_dir.iterdir()]
expected = InitEntrypoint.PROVIDER_TEMPLATES[args_dict["provider"]][
args_dict["oscal-model"]
]
assert workflow_files == expected
assert sorted(workflow_files) == sorted(expected)

assert any(
record.levelno == logging.INFO
Expand Down

0 comments on commit f5752f5

Please sign in to comment.