6
6
)
7
7
8
8
9
- def given_a_diff_structure_with_no_changes_it_should_return_an_exit_result_code ():
9
+ def given_an_empty_dvc_diff_it_should_exit ():
10
+
11
+ dvc_diff_with_added_gold_image = {}
12
+
13
+ result = check_images_changes (compact_json (dvc_diff_with_added_gold_image ))
14
+
15
+ assert result .code == ResultCode .EXIT
16
+
17
+
18
+ def given_a_diff_structure_with_no_changes_it_should_exit ():
10
19
11
20
dvc_diff_with_added_gold_image = {
12
21
"added" : [],
@@ -20,16 +29,23 @@ def given_a_diff_structure_with_no_changes_it_should_return_an_exit_result_code(
20
29
assert result .code == ResultCode .EXIT
21
30
22
31
23
- def given_an_empty_structure_it_should_return_an_exit_result_code ():
32
+ def given_a_diff_structure_with_added_files_it_should_continue ():
24
33
25
- dvc_diff_with_added_gold_image = {}
34
+ dvc_diff_with_added_gold_image = {
35
+ "added" : [
36
+ {"path" : "data/000001/52/000001-52.600.2.tif" },
37
+ ],
38
+ "deleted" : [],
39
+ "modified" : [],
40
+ "renamed" : [],
41
+ }
26
42
27
43
result = check_images_changes (compact_json (dvc_diff_with_added_gold_image ))
28
44
29
- assert result .code == ResultCode .EXIT
45
+ assert result .code == ResultCode .CONTINUE
30
46
31
47
32
- def given_a_diff_structure_with_changes_it_should_return_an_continue_result_code ():
48
+ def given_a_diff_structure_with_deleted_files_it_should_continue ():
33
49
34
50
dvc_diff_with_added_gold_image = {
35
51
"added" : [],
@@ -43,3 +59,40 @@ def given_a_diff_structure_with_changes_it_should_return_an_continue_result_code
43
59
result = check_images_changes (compact_json (dvc_diff_with_added_gold_image ))
44
60
45
61
assert result .code == ResultCode .CONTINUE
62
+
63
+
64
+ def given_a_diff_structure_with_modified_files_it_should_continue ():
65
+
66
+ dvc_diff_with_added_gold_image = {
67
+ "added" : [],
68
+ "deleted" : [],
69
+ "modified" : [
70
+ {"path" : "data/000001/52/000001-52.600.2.tif" },
71
+ ],
72
+ "renamed" : [],
73
+ }
74
+
75
+ result = check_images_changes (compact_json (dvc_diff_with_added_gold_image ))
76
+
77
+ assert result .code == ResultCode .CONTINUE
78
+
79
+
80
+ def given_a_diff_structure_with_renamed_files_it_should_continue ():
81
+
82
+ dvc_diff_with_added_gold_image = {
83
+ "added" : [],
84
+ "deleted" : [],
85
+ "modified" : [],
86
+ "renamed" : [
87
+ {
88
+ "path" : {
89
+ "old" : "data/000001/32/000001-32.600.2.tif" ,
90
+ "new" : "data/000002/32/000002-32.600.2.tif" ,
91
+ }
92
+ }
93
+ ],
94
+ }
95
+
96
+ result = check_images_changes (compact_json (dvc_diff_with_added_gold_image ))
97
+
98
+ assert result .code == ResultCode .CONTINUE
0 commit comments