Skip to content

Commit 00e643f

Browse files
committed
added unit test
Signed-off-by: Felix Rubio <[email protected]>
1 parent 4630e86 commit 00e643f

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

tests/unit/test_container_to_build_args.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,33 @@ def test_labels(self):
126126
'.',
127127
],
128128
)
129+
130+
def test_caches(self):
131+
c = create_compose_mock()
132+
133+
cnt = get_minimal_container()
134+
cnt['build']['cache_from'] = ['registry/image1', 'registry/image2']
135+
cnt['build']['cache_to'] = ['registry/image3', 'registry/image4']
136+
args = get_minimal_args()
137+
138+
args = container_to_build_args(c, cnt, args, lambda path: True)
139+
self.assertEqual(
140+
args,
141+
[
142+
'-f',
143+
'./Containerfile',
144+
'-t',
145+
'new-image',
146+
'--no-cache',
147+
'--pull-always',
148+
'--cache-from',
149+
'registry/image1',
150+
'--cache-from',
151+
'registry/image2',
152+
'--cache-to',
153+
'registry/image3',
154+
'--cache-to',
155+
'registry/image4',
156+
'.',
157+
],
158+
)

0 commit comments

Comments
 (0)