@@ -23,7 +23,7 @@ def test_get_new_gold_images_from_dvc_diff():
23
23
dvc_diff = {
24
24
"added" : [
25
25
{"path" : "data/000001/32/000001-32.600.2.tif" },
26
- {"path" : "data/000001/42 /000001-42 .600.2.tif" },
26
+ {"path" : "data/000001/52 /000001-52 .600.2.tif" },
27
27
],
28
28
"deleted" : [],
29
29
"modified" : [],
@@ -44,28 +44,28 @@ def test_calculate_the_corresponding_base_image_from_gold_image():
44
44
)
45
45
46
46
assert base_image_path == (
47
- "data/000001/42 /000001-42 .600.2.tif" , # relative path
48
- "/home/repo/data/000001/42 /000001-42 .600.2.tif" , # absolute path
47
+ "data/000001/52 /000001-52 .600.2.tif" , # relative path
48
+ "/home/repo/data/000001/52 /000001-52 .600.2.tif" , # absolute path
49
49
)
50
50
51
51
52
52
def remove_base_image_dvc_files (temp_git_dir ):
53
- os .remove (f"{ temp_git_dir } /data/000001/42 /000001-42 .600.2.tif.dvc" )
54
- os .remove (f"{ temp_git_dir } /data/000001/42 /.gitignore" )
53
+ os .remove (f"{ temp_git_dir } /data/000001/52 /000001-52 .600.2.tif.dvc" )
54
+ os .remove (f"{ temp_git_dir } /data/000001/52 /.gitignore" )
55
55
56
56
57
57
def overwrite_base_image (fixtures_dir , temp_git_dir ):
58
58
shutil .copyfile (
59
- f"{ fixtures_dir } /images/000001-42 .600.2-modified.tif" ,
60
- f"{ temp_git_dir } /data/000001/42 /000001-42 .600.2.tif" ,
59
+ f"{ fixtures_dir } /images/000001-52 .600.2-modified.tif" ,
60
+ f"{ temp_git_dir } /data/000001/52 /000001-52 .600.2.tif" ,
61
61
)
62
62
63
63
64
64
def rename_base_image (temp_git_dir ):
65
65
execute_shell_command (
66
66
"""
67
- mkdir -p data/000002/42
68
- dvc move data/000001/42 /000001-42 .600.2.tif data/000002/42 /000002-42 .600.2.tif
67
+ mkdir -p data/000002/52
68
+ dvc move data/000001/52 /000001-52 .600.2.tif data/000002/52 /000002-52 .600.2.tif
69
69
""" ,
70
70
cwd = temp_git_dir ,
71
71
print_output = True ,
@@ -75,7 +75,7 @@ def rename_base_image(temp_git_dir):
75
75
def add_base_image_to_dvc (temp_git_dir ):
76
76
execute_shell_command (
77
77
"""
78
- dvc add data/000001/42 /000001-42 .600.2.tif
78
+ dvc add data/000001/52 /000001-52 .600.2.tif
79
79
""" ,
80
80
cwd = temp_git_dir ,
81
81
print_output = True ,
@@ -145,12 +145,12 @@ def given_a_dvc_diff_object_with_a_new_gold_image_it_should_commit_the_added_bas
145
145
repo = Repo (temp_git_dir )
146
146
commit = repo .commit (repo .heads [0 ].commit ) # latest commit on the branch
147
147
148
- assert_commit_summary (commit , "feat: new base image: 000001-42 .600.2.tif" )
148
+ assert_commit_summary (commit , "feat: new base image: 000001-52 .600.2.tif" )
149
149
150
150
# Assert the commit contains the right files
151
151
expected_commit_stats_files = {
152
- "data/000001/42 /.gitignore" : {"insertions" : 1 , "deletions" : 0 , "lines" : 1 },
153
- "data/000001/42 /000001-42 .600.2.tif.dvc" : {
152
+ "data/000001/52 /.gitignore" : {"insertions" : 1 , "deletions" : 0 , "lines" : 1 },
153
+ "data/000001/52 /000001-52 .600.2.tif.dvc" : {
154
154
"insertions" : 4 ,
155
155
"deletions" : 0 ,
156
156
"lines" : 4 ,
@@ -201,11 +201,11 @@ def given_a_dvc_diff_object_with_a_gold_image_deleton_it_should_commit_the_base_
201
201
repo = Repo (temp_git_dir )
202
202
commit = repo .commit (repo .heads [0 ].commit ) # latest commit on the branch
203
203
204
- assert_commit_summary (commit , "feat: deleted base image: 000001-42 .600.2.tif" )
204
+ assert_commit_summary (commit , "feat: deleted base image: 000001-52 .600.2.tif" )
205
205
206
206
expected_commit_stats_files = {
207
- "data/000001/42 /.gitignore" : {"insertions" : 0 , "deletions" : 1 , "lines" : 1 },
208
- "data/000001/42 /000001-42 .600.2.tif.dvc" : {
207
+ "data/000001/52 /.gitignore" : {"insertions" : 0 , "deletions" : 1 , "lines" : 1 },
208
+ "data/000001/52 /000001-52 .600.2.tif.dvc" : {
209
209
"insertions" : 0 ,
210
210
"deletions" : 4 ,
211
211
"lines" : 4 ,
@@ -257,16 +257,16 @@ def given_a_dvc_diff_object_with_a_gold_image_rename_it_should_commit_the_base_i
257
257
commit = repo .commit (repo .heads [0 ].commit )
258
258
259
259
expected_commit_stats_files = {
260
- "data/000001/42 /.gitignore" : {"insertions" : 0 , "deletions" : 1 , "lines" : 1 },
261
- "data/000002/42 /.gitignore" : {"insertions" : 3 , "deletions" : 0 , "lines" : 3 },
262
- "data/{000001/42 /000001-42 .600.2.tif.dvc => 000002/42 /000002-42 .600.2.tif.dvc}" : {
260
+ "data/000001/52 /.gitignore" : {"insertions" : 0 , "deletions" : 1 , "lines" : 1 },
261
+ "data/000002/52 /.gitignore" : {"insertions" : 3 , "deletions" : 0 , "lines" : 3 },
262
+ "data/{000001/52 /000001-52 .600.2.tif.dvc => 000002/52 /000002-52 .600.2.tif.dvc}" : {
263
263
"insertions" : 1 ,
264
264
"deletions" : 1 ,
265
265
"lines" : 2 ,
266
266
},
267
267
}
268
268
assert_commit_summary (
269
- commit , "feat: renamed base image: 000001-42 .600.2.tif -> 000002-42 .600.2.tif"
269
+ commit , "feat: renamed base image: 000001-52 .600.2.tif -> 000002-52 .600.2.tif"
270
270
)
271
271
assert_commit_content (commit , expected_commit_stats_files , git_user )
272
272
assert_commit_signingkey (commit , temp_git_dir , git_user )
@@ -309,10 +309,10 @@ def given_a_dvc_diff_object_with_a_gold_image_modification_it_should_commit_the_
309
309
310
310
commit = repo .commit (repo .heads [0 ].commit )
311
311
312
- assert_commit_summary (commit , "feat: modified base image: 000001-42 .600.2.tif" )
312
+ assert_commit_summary (commit , "feat: modified base image: 000001-52 .600.2.tif" )
313
313
314
314
expected_commit_stats_files = {
315
- "data/000001/42 /000001-42 .600.2.tif.dvc" : {
315
+ "data/000001/52 /000001-52 .600.2.tif.dvc" : {
316
316
"insertions" : 2 ,
317
317
"deletions" : 2 ,
318
318
"lines" : 4 ,
0 commit comments