-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
but have a question about the location of the .toml file.
- Loading branch information
1 parent
53dfccf
commit 93fac0e
Showing
3 changed files
with
35 additions
and
2 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,5 @@ | ||
[tool.pytest.ini_options] | ||
addopts = "-ra --cov" | ||
testpaths = ['tests'] | ||
pythonpath = ['.'] | ||
|
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,25 @@ | ||
|
||
from ush.python_utils.misc import * | ||
|
||
class TestMisc: | ||
"""Test the misc.py functions.""" | ||
|
||
def test_uc(self): | ||
"""Test the uppercase() function.""" | ||
assert uppercase('s') == 'S' | ||
|
||
def test_lc(self): | ||
"""Test the lowercase() function.""" | ||
assert lowercase('S') == 's' | ||
|
||
def test_find_pattern_in_str(self): | ||
"""Test the find_pattern_in_str() function.""" | ||
assert not find_pattern_in_str('.', 's') | ||
|
||
def test_find_pattern_in_fike(self): | ||
"""Test the find_pattern_in_file() function.""" | ||
f = open("test_misc.txt", "w") | ||
f.write("Hello World from " + f.name) | ||
f.close() | ||
assert not find_pattern_in_file('H', "test_misc.txt") | ||
|