Skip to content

Commit

Permalink
added unit test
Browse files Browse the repository at this point in the history
Signed-off-by: Felix Rubio <felix@kngnt.org>
  • Loading branch information
flixman committed Dec 30, 2024
1 parent 4630e86 commit 00e643f
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/unit/test_container_to_build_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,33 @@ def test_labels(self):
'.',
],
)

def test_caches(self):
c = create_compose_mock()

cnt = get_minimal_container()
cnt['build']['cache_from'] = ['registry/image1', 'registry/image2']
cnt['build']['cache_to'] = ['registry/image3', 'registry/image4']
args = get_minimal_args()

args = container_to_build_args(c, cnt, args, lambda path: True)
self.assertEqual(
args,
[
'-f',
'./Containerfile',
'-t',
'new-image',
'--no-cache',
'--pull-always',
'--cache-from',
'registry/image1',
'--cache-from',
'registry/image2',
'--cache-to',
'registry/image3',
'--cache-to',
'registry/image4',
'.',
],
)

0 comments on commit 00e643f

Please sign in to comment.