-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix incorrect exception for bad paths
- Loading branch information
Paul Vergeev
committed
Apr 30, 2018
1 parent
a9aed94
commit cb7a723
Showing
2 changed files
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
tests/test_validation_interface/test_incorrect_input_handled.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import os.path | ||
|
||
import pytest | ||
|
||
from fiasko_bro import validate | ||
|
||
|
||
@pytest.fixture(scope='session') | ||
def non_existent_directory(): | ||
directory = 'test_fixtures{}directory_that_should_not_exist'.format(os.path.sep) | ||
assert not os.path.isdir(directory) | ||
return directory | ||
|
||
|
||
def test_not_existing_file_raises_correct_exception(non_existent_directory): | ||
with pytest.raises(FileNotFoundError): | ||
validate(non_existent_directory) |