Skip to content

Commit

Permalink
test: alters test_compdef.py to make the file to test deterministic
Browse files Browse the repository at this point in the history
Signed-off-by: Jennifer Power <[email protected]>
  • Loading branch information
jpower432 committed Oct 14, 2023
1 parent e60ebb5 commit 3b5200c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/trestlebot/tasks/authored/test_compdef.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"""Test for Trestle Bot Authored Compdef."""

import pathlib
import re

import pytest

Expand Down Expand Up @@ -52,8 +53,11 @@ def test_create_new_default(tmp_trestle_dir: str) -> None:
yaml_files = list(comp_dir.glob(f"*{YAML_EXTENSION}"))
assert len(yaml_files) == 12

rule_file = next((file for file in yaml_files if re.search(r'ac-5', file.stem)), None)
assert rule_file is not None

# Read one of the files and check the content
rule_path = pathlib.Path(yaml_files[0])
rule_path = pathlib.Path(rule_file)
rule_stream = rule_path.read_text()

transformer = ToRulesYAMLTransformer()
Expand Down

0 comments on commit 3b5200c

Please sign in to comment.