test: Allow turning strictness off as well
When the value is explicitly set to `False`, the check should not be strict. JIRA: COMPOSE-3658 Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
parent
61e3cb0ef1
commit
3097019338
3 changed files with 24 additions and 1 deletions
|
|
@ -202,6 +202,27 @@ class TestCheckImageSanity(PungiTestCase):
|
|||
"ISO Client/i386/iso/image.iso is too big. Expected max 10B, got 20B",
|
||||
)
|
||||
|
||||
@mock.patch("pungi.phases.test.check_sanity", new=mock.Mock())
|
||||
def test_too_big_iso_not_strict(self):
|
||||
compose = DummyCompose(
|
||||
self.topdir,
|
||||
{
|
||||
"createiso_max_size": [(".*", {"*": 10})],
|
||||
"createiso_max_size_is_strict": [(".*", {"*": False})],
|
||||
},
|
||||
)
|
||||
compose.image.format = 'iso'
|
||||
compose.image.bootable = False
|
||||
compose.image.size = 20
|
||||
|
||||
test_phase.check_image_sanity(compose)
|
||||
|
||||
warnings = [call[0][0] for call in compose.log_warning.call_args_list]
|
||||
self.assertIn(
|
||||
"ISO Client/i386/iso/image.iso is too big. Expected max 10B, got 20B",
|
||||
warnings,
|
||||
)
|
||||
|
||||
@mock.patch("pungi.phases.test.check_sanity", new=mock.Mock())
|
||||
def test_too_big_unified(self):
|
||||
compose = DummyCompose(self.topdir, {})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue