-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from uncle-lv/test-cov
add pytest-cov and test validate_file_name
- Loading branch information
Showing
7 changed files
with
195 additions
and
16 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
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
Empty file.
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,15 @@ | ||
import pytest | ||
from argparse import ArgumentTypeError | ||
|
||
from pydumpling.helpers import validate_file_name | ||
|
||
|
||
def test_validate_file_name(): | ||
dump_file = "./tests/dump/validate_file_name.dump" | ||
assert validate_file_name(dump_file) == dump_file | ||
|
||
with pytest.raises(ArgumentTypeError, match="File must be .dump file"): | ||
validate_file_name("test.txt") | ||
|
||
with pytest.raises(ArgumentTypeError, match="File missing.dump not found"): | ||
validate_file_name("missing.dump") |