Files
openfe/openfecli/tests/parameters/test_output.py
David W.H. Swenson c8a9cf1465 Combine visualization with CLI (#72)
Co-authored-by: richard <richard@nextmovesoftware.com>
2022-03-01 15:07:10 +00:00

14 lines
414 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