-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature 1608 METDbLoad read MODE/MTD txt files (#1628)
- Loading branch information
1 parent
b9cef28
commit 324da1b
Showing
3 changed files
with
75 additions
and
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import pytest | ||
|
||
from metplus.wrappers.met_db_load_wrapper import METDbLoadWrapper | ||
|
||
@pytest.mark.parametrize( | ||
'filename, expected_result', [ | ||
('myfile.png', False), | ||
('anotherfile.txt', False), | ||
('goodfile.stat', True), | ||
('goodfile.tcst', True), | ||
('mode_goodfile.txt', True), | ||
('mtd_goodfile.txt', True), | ||
('monster_badfile.txt', False), | ||
] | ||
) | ||
def test_is_loadable_file(filename, expected_result): | ||
assert METDbLoadWrapper._is_loadable_file(filename) == expected_result | ||
|
||
@pytest.mark.parametrize( | ||
'filenames, expected_result', [ | ||
(['myfile.png', | ||
'anotherfile.txt'], False), | ||
(['myfile.png', | ||
'goodfile.stat'], True), | ||
(['myfile.png', | ||
'goodfile.tcst', | ||
'anotherfile.txt'], True), | ||
(['myfile.png', | ||
'mode_goodfile.txt'], True), | ||
(['myfile.png', | ||
'mtd_goodfile.txt'], True), | ||
(['myfile.png', | ||
'monster_badfile.txt'], False), | ||
([], False), | ||
] | ||
) | ||
def test_has_loadable_file(filenames, expected_result): | ||
assert METDbLoadWrapper._has_loadable_file(filenames) == expected_result |
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