generated from ACCESS-NRI/template
-
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.
Merge pull request #43 from CABLE-LSM/41-change-tests-to-in-memory-files
Changed upload logic and tests to require paths, rather than file obj…
- Loading branch information
Showing
4 changed files
with
55 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
"""Test utility functions.""" | ||
|
||
import meorg_client.utilities as mu | ||
from pathlib import Path | ||
|
||
|
||
def test_ensure_list(): | ||
"""Test ensure_list.""" | ||
|
||
# Test null case | ||
result = mu.ensure_list([1]) | ||
assert isinstance(result, list) | ||
|
||
# Test casting | ||
result = mu.ensure_list(1) | ||
assert isinstance(result, list) | ||
|
||
|
||
def test_get_user_data_filepath(): | ||
"""Test get_user_data_filepath.""" | ||
result = mu.get_user_data_filepath("test.txt") | ||
assert result == Path.home() / ".meorg" / "test.txt" | ||
|
||
|
||
def test_load_package_data(): | ||
"""Test load_package_data.""" | ||
result = mu.load_package_data("openapi.json") | ||
assert isinstance(result, dict) |
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