mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
tests: add result examples
This commit is contained in:
+1
-1
@@ -35,7 +35,7 @@ def add_parser(subparsers, parent_parser):
|
||||
"a_ref",
|
||||
help="Git reference from which diff calculates (defaults to HEAD)",
|
||||
nargs="?",
|
||||
default="HEAD"
|
||||
default="HEAD",
|
||||
)
|
||||
diff_parser.add_argument(
|
||||
"b_ref",
|
||||
|
||||
+42
-3
@@ -10,21 +10,60 @@ def test_no_scm(tmp_dir, dvc):
|
||||
def test_added(tmp_dir, scm, dvc):
|
||||
tmp_dir.dvc_gen("file", "text")
|
||||
|
||||
pytest.skip("TODO: define output structure")
|
||||
result = {
|
||||
"old": [],
|
||||
"new": [
|
||||
{
|
||||
"filename": "file",
|
||||
"checksum": "1cb251ec0d568de6a929b520c4aed8d1",
|
||||
"size": 4,
|
||||
}
|
||||
],
|
||||
}
|
||||
|
||||
assert result == dvc.diff()
|
||||
|
||||
|
||||
def test_deleted(tmp_dir, scm, dvc):
|
||||
tmp_dir.dvc_gen("file", "text", commit="add file")
|
||||
(tmp_dir / "file").unlink()
|
||||
|
||||
pytest.skip("TODO: define output structure")
|
||||
result = {
|
||||
"old": [
|
||||
{
|
||||
"filename": "file",
|
||||
"checksum": "1cb251ec0d568de6a929b520c4aed8d1",
|
||||
"size": 4,
|
||||
}
|
||||
],
|
||||
"new": [],
|
||||
}
|
||||
|
||||
assert result == dvc.diff()
|
||||
|
||||
|
||||
def test_modified(tmp_dir, scm, dvc):
|
||||
tmp_dir.dvc_gen("file", "first", commit="first version")
|
||||
tmp_dir.dvc_gen("file", "second")
|
||||
|
||||
pytest.skip("TODO: define output structure")
|
||||
result = {
|
||||
"old": [
|
||||
{
|
||||
"filename": "file",
|
||||
"checksum": "8b04d5e3775d298e78455efc5ca404d5",
|
||||
"size": 6,
|
||||
}
|
||||
],
|
||||
"new": [
|
||||
{
|
||||
"filename": "file",
|
||||
"checksum": "a9f0e61a137d86aa9db53465e0801612",
|
||||
"size": 6,
|
||||
}
|
||||
],
|
||||
}
|
||||
|
||||
assert result == dvc.diff()
|
||||
|
||||
|
||||
def test_refs(tmp_dir, scm, dvc):
|
||||
|
||||
Reference in New Issue
Block a user