-
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.
- Loading branch information
1 parent
22b78f5
commit 5432fbd
Showing
3 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
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,3 @@ | ||
from utils.fix_string import string_test, string_to_float | ||
from utils.mann_kendall import mk_test | ||
|
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,19 @@ | ||
import pytest | ||
|
||
from .context import string_test, string_to_float | ||
|
||
|
||
def test_string_to_float(): | ||
value = "< 2" | ||
string = 'test<' | ||
assert 2 == string_to_float(value) | ||
assert type(string_to_float(value)) == float | ||
with pytest.raises(ValueError): | ||
string_to_float(string) | ||
|
||
|
||
def test_string_to_test(): | ||
value = "2" | ||
string = 'test' | ||
assert None == string_test(value) | ||
assert 'test' == string_test(string) |