-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove monai massive load dependency and redo with requests and tarfile
- Loading branch information
1 parent
76dd6d2
commit dcea06c
Showing
4 changed files
with
138 additions
and
18 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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
chris_plugin==0.4.0 | ||
monai-weekly | ||
tqdm | ||
twine |
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,21 +1,20 @@ | ||
from pathlib import Path | ||
|
||
from spleendata import parser, main | ||
from spleendatads import parser, main | ||
|
||
|
||
def test_main(tmp_path: Path): | ||
def test_main(tmp_path: Path, capsys): | ||
# setup example data | ||
inputdir = tmp_path / 'incoming' | ||
outputdir = tmp_path / 'outgoing' | ||
inputdir = tmp_path / "incoming" | ||
outputdir = tmp_path / "outgoing" | ||
inputdir.mkdir() | ||
outputdir.mkdir() | ||
(inputdir / 'plaintext.txt').write_text('hello ChRIS, I am a ChRIS plugin') | ||
(inputdir / "plaintext.txt").write_text("hello ChRIS, I am a ChRIS plugin") | ||
|
||
# simulate run of main function | ||
options = parser.parse_args(['--word', 'ChRIS', '--pattern', '*.txt']) | ||
options = parser.parse_args(["--version"]) | ||
main(options, inputdir, outputdir) | ||
|
||
# assert behavior is expected | ||
expected_output_file = outputdir / 'plaintext.count.txt' | ||
assert expected_output_file.exists() | ||
assert expected_output_file.read_text() == '2' | ||
captured = capsys.readouterr() | ||
assert "Version" in captured.out |