mirror of
https://github.com/OpenFreeEnergy/openfe.git
synced 2026-06-04 22:34:24 +08:00
14 lines
414 B
Python
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
|