-
Notifications
You must be signed in to change notification settings - Fork 8
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 #167 from benjeffery/preprocess
Move preprocessing to separate step
- Loading branch information
Showing
15 changed files
with
1,079 additions
and
989 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,31 @@ | ||
import os | ||
|
||
import tszip | ||
from click.testing import CliRunner | ||
|
||
from . import test_preprocess | ||
from tsbrowse import __main__ as main | ||
|
||
|
||
def test_preprocess_cli(tmpdir): | ||
tszip_path = os.path.join(tmpdir, "test_input.tszip") | ||
default_output_path = os.path.join(tmpdir, "test_input.tsbrowse") | ||
custom_output_path = os.path.join(tmpdir, "custom_input.tsbrowse") | ||
|
||
ts = test_preprocess.single_tree_example_ts() | ||
tszip.compress(ts, tszip_path) | ||
|
||
runner = CliRunner() | ||
result = runner.invoke(main.cli, ["preprocess", tszip_path]) | ||
assert result.exit_code == 0 | ||
assert os.path.exists(default_output_path) | ||
tszip.load(default_output_path).tables.assert_equals(ts.tables) | ||
|
||
result = runner.invoke( | ||
main.cli, ["preprocess", tszip_path, "--output", custom_output_path] | ||
) | ||
assert result.exit_code == 0 | ||
assert os.path.exists(custom_output_path) | ||
tszip.load(custom_output_path).tables.assert_equals(ts.tables) | ||
|
||
# TODO Load into model and check that the model is correct |
Oops, something went wrong.