-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: test helper
modify_dataset()
and modified_dataset
This is a more flexible and more robust variant of the datalad-next fixture `modified_dataset`, split into a test helper and the actual fixture. Unlike the datalad-next version, it does not require any datalad commands to work, just plain Git.
- Loading branch information
Showing
5 changed files
with
239 additions
and
4 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,6 @@ | ||
def test_modified_dataset_fixture(modified_dataset): | ||
assert modified_dataset | ||
# the test is to do nothing. | ||
# the dataset modification will be done, the promised capture | ||
# before the test starts. the test will then do nothing, and | ||
# the promise is reevaluated at the end and must succeed. |
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,12 @@ | ||
from datalad_core.runners import call_git | ||
from datalad_core.tests.utils import modify_dataset | ||
|
||
|
||
def test_modify_dataset(gitrepo): | ||
promise = modify_dataset(gitrepo) | ||
assert promise == call_git( | ||
['status', '-uall', '--porcelain=v1'], | ||
cwd=gitrepo, | ||
capture_output=True, | ||
text=True, | ||
) |
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