Skip to content

Commit

Permalink
Update tests, lower() for extention comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
psobolewskiPhD committed Apr 6, 2023
1 parent 579f79f commit b140215
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/test__io_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,19 @@ def test_read_with_unknown_plugin(uses_sample_plugin):
# no such plugin name.... skips over the sample plugin & error is specific
with pytest.raises(ValueError, match="Plugin 'nope' was selected"):
read(["some.fzzy"], plugin_name="nope", stack=False)

def test_read_uppercase_extension(uses_sample_plugin):
# sample plugin hard-codes lower case and returns this error
# so the error ensures the matching was case-insensitive
# and that the sample plugin received full path (with case)
with pytest.raises(ValueError, match="Test plugin should"):
read(["some.FZZY"], stack=False)


def test_read_with_plugin(uses_sample_plugin):
# no such plugin name.... but skips over the sample plugin
with pytest.raises(ValueError):
read(["some.fzzy"], plugin_name="nope", stack=False)


def test_read_with_no_plugin():
Expand All @@ -30,6 +43,16 @@ def test_read_return_reader(uses_sample_plugin):
assert reader.command == f"{SAMPLE_PLUGIN_NAME}.some_reader"


def test_read_uppercase_extension_return_reader(uses_sample_plugin):
# sample plugin hard-codes lower case and returns this error
# so the error ensures the matching was case-insensitive
# and that the sample plugin received full path (with case)
with pytest.raises(ValueError, match="Test plugin should"):
data, reader = read_get_reader("some.FZZY")
assert data == [(None,)]
assert reader.command == f"{SAMPLE_PLUGIN_NAME}.some_reader"


def test_read_return_reader_with_stack(uses_sample_plugin):
data, reader = read_get_reader(["some.fzzy"], stack=True)
assert data == [(None,)]
Expand Down

0 comments on commit b140215

Please sign in to comment.