Raise error instead of trying to fix bad names.
Thanks for the advice, @radl97
This commit is contained in:
parent
04c3486b83
commit
ec64a0b5f1
4 changed files with 23 additions and 3 deletions
|
|
@ -24,6 +24,20 @@ def test_uninitialized() -> None:
|
|||
LargeFileS3("test-file")
|
||||
|
||||
|
||||
def test_bad_file_name() -> None:
|
||||
with pytest.raises(ValueError):
|
||||
LargeFileS3("../no-no", cache_only_mode=True)
|
||||
|
||||
with pytest.raises(ValueError):
|
||||
LargeFileS3("is this wrong?", cache_only_mode=True)
|
||||
|
||||
with pytest.raises(FileNotFoundError):
|
||||
LargeFileS3("!378378_fer-ef", cache_only_mode=True) # this should work
|
||||
|
||||
with pytest.raises(FileNotFoundError):
|
||||
LargeFileS3("3", cache_only_mode=True) # this should work
|
||||
|
||||
|
||||
def test_bad_file_modes() -> None:
|
||||
with pytest.raises(ValueError):
|
||||
LargeFileS3("test-file", "w", version=3)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue