Remove check for disc type
This will get validated in productmd anyway, no need to duplicate the check in Pungi itself. Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
parent
c1b8fbe4f9
commit
be8605ac91
@ -309,8 +309,6 @@ class Compose(kobo.log.LoggingBase):
|
|||||||
if arch == "src":
|
if arch == "src":
|
||||||
arch = "source"
|
arch = "source"
|
||||||
|
|
||||||
if disc_type not in ("cd", "dvd", "ec2", "live", "boot"):
|
|
||||||
raise RuntimeError("Unsupported disc type: %s" % disc_type)
|
|
||||||
if disc_num:
|
if disc_num:
|
||||||
disc_num = int(disc_num)
|
disc_num = int(disc_num)
|
||||||
else:
|
else:
|
||||||
|
@ -71,6 +71,34 @@ class ComposeTestCase(unittest.TestCase):
|
|||||||
'RC-1.0', '1', 'rel_short', '2', '.iso', 'nightly',
|
'RC-1.0', '1', 'rel_short', '2', '.iso', 'nightly',
|
||||||
'.n', 'Server', '3.0']))
|
'.n', 'Server', '3.0']))
|
||||||
|
|
||||||
|
@mock.patch('pungi.compose.ComposeInfo')
|
||||||
|
def test_get_image_name_type_netinst(self, ci):
|
||||||
|
conf = {}
|
||||||
|
variant = mock.Mock(uid='Server', type='variant')
|
||||||
|
ci.return_value.compose.respin = 2
|
||||||
|
ci.return_value.compose.id = 'compose_id'
|
||||||
|
ci.return_value.compose.date = '20160107'
|
||||||
|
ci.return_value.compose.type = 'nightly'
|
||||||
|
ci.return_value.compose.type_suffix = '.n'
|
||||||
|
ci.return_value.compose.label = 'RC-1.0'
|
||||||
|
ci.return_value.compose.label_major_version = '1'
|
||||||
|
|
||||||
|
ci.return_value.release.version = '3.0'
|
||||||
|
ci.return_value.release.short = 'rel_short'
|
||||||
|
|
||||||
|
compose = Compose(conf, self.tmp_dir)
|
||||||
|
|
||||||
|
keys = ['arch', 'compose_id', 'date', 'disc_num', 'disc_type',
|
||||||
|
'label', 'label_major_version', 'release_short', 'respin',
|
||||||
|
'suffix', 'type', 'type_suffix', 'variant', 'version']
|
||||||
|
format = '-'.join(['%(' + k + ')s' for k in keys])
|
||||||
|
name = compose.get_image_name('x86_64', variant, format=format,
|
||||||
|
disc_num=7, disc_type='netinst', suffix='.iso')
|
||||||
|
|
||||||
|
self.assertEqual(name, '-'.join(['x86_64', 'compose_id', '20160107', '7', 'netinst',
|
||||||
|
'RC-1.0', '1', 'rel_short', '2', '.iso', 'nightly',
|
||||||
|
'.n', 'Server', '3.0']))
|
||||||
|
|
||||||
|
|
||||||
class StatusTest(unittest.TestCase):
|
class StatusTest(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user