Files
openfe/openfecli/tests/parameters/test_output.py
Alyssa Travitz 036869ae81 Ci/add ruff format part4 - the final format! (#1623)
* format cli tests top level

* format cli commands tests

* format cli parameters tests
2025-10-24 23:50:52 +00:00

17 lines
437 B
Python

import pytest
from openfecli.parameters.output import get_file_and_extension
@pytest.mark.parametrize(
"fname,expected_ext",
[
("foo.bar", "bar"),
("foo.bar.bz", "bz"),
],
)
def test_get_file_and_extension(tmpdir, fname, expected_ext):
with open(tmpdir / fname, mode="w") as file:
outfile, ext = get_file_and_extension(file, {})
assert outfile is file
assert ext == expected_ext