Skip to content

Commit

Permalink
fix test code to support different add_file_task str
Browse files Browse the repository at this point in the history
  • Loading branch information
torcolvin committed Feb 4, 2025
1 parent b9a99d0 commit ae59f15
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions tools-tests/tasks_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,25 @@


@pytest.mark.parametrize("tag_userdata", [True, False])
def test_add_file_task(tmpdir, tag_userdata):
def test_add_file_task(tmp_path, tag_userdata):
if tag_userdata:
expected = REDACTED_OUTPUT
else:
expected = REDACTED_OUTPUT.replace("<ud>foo</ud>", "foo")

filename = "config.json"
config_file = tmpdir.join(filename)
config_file.write(INPUT_CONFIG)
config_file = tmp_path / filename
config_file.write_text(INPUT_CONFIG)
postprocessors = [password_remover.remove_passwords]
if tag_userdata:
postprocessors.append(password_remover.tag_userdata_in_server_config)
task = tasks.add_file_task(
config_file.strpath,
str(config_file),
output_path=config_file.name,
content_postprocessors=postprocessors,
)
output_dir = tmpdir.mkdir("output")
output_dir = tmp_path / "output"
output_dir.mkdir()
runner = tasks.TaskRunner(
verbosity=VERBOSE,
default_name="sg.log",
Expand Down

0 comments on commit ae59f15

Please sign in to comment.