-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use preferred is_file and import sytax
- Loading branch information
Showing
3 changed files
with
14 additions
and
14 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
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
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 |
---|---|---|
@@ -1,19 +1,19 @@ | ||
from pathlib import Path | ||
|
||
from electos.ballotmaker import make_ballots | ||
from electos.ballotmaker.constants import NO_ERRORS, NO_FILE | ||
from electos.ballotmaker.make_ballots import make_ballots | ||
|
||
not_a_file = Path("not_a_file.json") | ||
imaginary_file = Path("imaginary_file.json") | ||
test_dir = Path(__file__).parent.resolve() | ||
test_file = Path("june_test_case.json") | ||
full_test_path = Path(test_dir, test_file) | ||
|
||
|
||
def test_make_ballots(): | ||
# force a no file error with Path = None | ||
assert make_ballots.make_ballots(_edf=None) == NO_FILE | ||
# ensure not_a_file is actually not a file | ||
assert Path.is_file(not_a_file) == False | ||
assert make_ballots.make_ballots(not_a_file) == NO_FILE | ||
assert Path.is_file(full_test_path) | ||
assert make_ballots.make_ballots(full_test_path) == NO_ERRORS | ||
assert make_ballots(_edf=None) == NO_FILE | ||
# ensure imaginary_file is actually not a file | ||
assert not imaginary_file.is_file() | ||
assert make_ballots(imaginary_file) == NO_FILE | ||
assert full_test_path.is_file() | ||
assert make_ballots(full_test_path) == NO_ERRORS |