-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add test case. - Add option to write diff out to a file (needed for test, but good functionality on its own). - Improved labelling when using full URLs to tool sheds.
- Loading branch information
Showing
2 changed files
with
44 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,30 @@ | ||
""" Integration tests for shed_diff command. | ||
""" | ||
|
||
import os | ||
from .test_utils import CliShedTestCase | ||
|
||
DIFF_LINES = [ | ||
"diff -r _local_/related_file _custom_shed_/related_file", | ||
"< A related non-tool file (modified).", | ||
"> A related non-tool file.", | ||
] | ||
|
||
|
||
class ShedUploadTestCase(CliShedTestCase): | ||
|
||
def test_shed_diff(self): | ||
with self._isolate_repo("single_tool") as f: | ||
upload_command = ["shed_upload", "--force_repository_creation"] | ||
upload_command.extend(self._shed_args()) | ||
self._check_exit_code(upload_command) | ||
with open(os.path.join(f, "related_file"), "w") as r_f: | ||
r_f.write("A related non-tool file (modified).\n") | ||
|
||
diff_command = ["shed_diff", "-o", "diff"] | ||
diff_command.extend(self._shed_args(read_only=True)) | ||
self._check_exit_code(diff_command) | ||
with open("diff", "r") as f: | ||
diff = f.read() | ||
for diff_line in DIFF_LINES: | ||
assert diff_line in diff |