-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add resolution function to common * Use resolution function in assertion and case * Add unit tests * Update CHANGELOG * Update version * Address linter * Clearer error message and remove assert * Update tests to include unit test for resolve_single_path function * Remove parenthesis * Remove unnecessary str * Update test to instantiate NFTestAssert
- Loading branch information
1 parent
d096b96
commit 39f1119
Showing
7 changed files
with
83 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
""" nftest module """ | ||
|
||
__version__ = '1.0.0-rc.4' | ||
__version__ = '1.0.0' |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# pylint: disable=W0212 | ||
''' Test module for common functions ''' | ||
|
||
import mock | ||
import pytest | ||
|
||
from nftest.common import resolve_single_path | ||
|
||
@pytest.mark.parametrize( | ||
'glob_return_value,case_pass', | ||
[ | ||
([], False), | ||
(['a', 'b'], False), | ||
(['a'], True) | ||
] | ||
) | ||
@mock.patch('glob.glob') | ||
def test_resolve_single_path(mock_glob, glob_return_value, case_pass): | ||
''' Tests for proper file identification ''' | ||
test_path = '/some/path' | ||
mock_glob.return_value = glob_return_value | ||
|
||
if case_pass: | ||
resolve_single_path(test_path) | ||
else: | ||
with pytest.raises(ValueError): | ||
resolve_single_path(test_path) |