Update tests to match the subvariant

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2016-03-10 18:54:42 +00:00 committed by Dennis Gilmore
parent 254bfb8ca4
commit c1b8fbe4f9
2 changed files with 23 additions and 3 deletions

View File

@ -55,6 +55,7 @@ class TestLiveImagesPhase(PungiTestCase):
'sign': False, 'sign': False,
'type': 'live', 'type': 'live',
'release': '20151203.0', 'release': '20151203.0',
'subvariant': 'Client',
'ksurl': None}, 'ksurl': None},
compose.variants['Client'], compose.variants['Client'],
'amd64'))]) 'amd64'))])
@ -102,6 +103,7 @@ class TestLiveImagesPhase(PungiTestCase):
'sign': False, 'sign': False,
'type': 'live', 'type': 'live',
'release': '20151203.0', 'release': '20151203.0',
'subvariant': 'Client',
'ksurl': None}, 'ksurl': None},
compose.variants['Client'], compose.variants['Client'],
'amd64'))]) 'amd64'))])
@ -146,6 +148,7 @@ class TestLiveImagesPhase(PungiTestCase):
'sign': False, 'sign': False,
'type': 'live', 'type': 'live',
'release': '20151203.0', 'release': '20151203.0',
'subvariant': 'Client',
'ksurl': None}, 'ksurl': None},
compose.variants['Client'], compose.variants['Client'],
'amd64'))]) 'amd64'))])
@ -192,6 +195,7 @@ class TestLiveImagesPhase(PungiTestCase):
'sign': False, 'sign': False,
'type': 'live', 'type': 'live',
'release': None, 'release': None,
'subvariant': 'Client',
'ksurl': None}, 'ksurl': None},
compose.variants['Client'], compose.variants['Client'],
'amd64')), 'amd64')),
@ -211,6 +215,7 @@ class TestLiveImagesPhase(PungiTestCase):
'sign': False, 'sign': False,
'type': 'live', 'type': 'live',
'release': None, 'release': None,
'subvariant': 'Client',
'ksurl': None}, 'ksurl': None},
compose.variants['Client'], compose.variants['Client'],
'amd64'))]) 'amd64'))])
@ -258,6 +263,7 @@ class TestLiveImagesPhase(PungiTestCase):
'sign': False, 'sign': False,
'type': 'appliance', 'type': 'appliance',
'release': None, 'release': None,
'subvariant': 'Client',
'ksurl': 'https://git.example.com/kickstarts.git?#CAFEBABE'}, 'ksurl': 'https://git.example.com/kickstarts.git?#CAFEBABE'},
compose.variants['Client'], compose.variants['Client'],
'amd64'))]) 'amd64'))])
@ -304,6 +310,7 @@ class TestLiveImagesPhase(PungiTestCase):
'sign': False, 'sign': False,
'type': 'live', 'type': 'live',
'release': '20151203.0', 'release': '20151203.0',
'subvariant': 'Client',
'ksurl': None}, 'ksurl': None},
compose.variants['Client'], compose.variants['Client'],
'amd64'))]) 'amd64'))])
@ -338,6 +345,7 @@ class TestCreateLiveImageThread(PungiTestCase):
'type': 'live', 'type': 'live',
'ksurl': 'https://git.example.com/kickstarts.git?#CAFEBABE', 'ksurl': 'https://git.example.com/kickstarts.git?#CAFEBABE',
'release': None, 'release': None,
'subvariant': 'Something',
} }
koji_wrapper = KojiWrapper.return_value koji_wrapper = KojiWrapper.return_value
@ -370,7 +378,7 @@ class TestCreateLiveImageThread(PungiTestCase):
]) ])
self.assertEqual(run.mock_calls, [mock.call(write_manifest_cmd)]) self.assertEqual(run.mock_calls, [mock.call(write_manifest_cmd)])
self.assertEqual(koji_wrapper.get_create_image_cmd.mock_calls, self.assertEqual(koji_wrapper.get_create_image_cmd.mock_calls,
[mock.call('Test', '20151203.0.t', 'rhel-7.0-candidate', [mock.call('test-Something-Live-amd64', '20151203.0.t', 'rhel-7.0-candidate',
'amd64', '/path/to/ks_file', 'amd64', '/path/to/ks_file',
['/repo/amd64/Client', ['/repo/amd64/Client',
'http://example.com/repo/', 'http://example.com/repo/',
@ -416,6 +424,7 @@ class TestCreateLiveImageThread(PungiTestCase):
'type': 'live', 'type': 'live',
'ksurl': 'https://git.example.com/kickstarts.git?#CAFEBABE', 'ksurl': 'https://git.example.com/kickstarts.git?#CAFEBABE',
'release': None, 'release': None,
'subvariant': 'Client',
} }
koji_wrapper = KojiWrapper.return_value koji_wrapper = KojiWrapper.return_value
@ -448,7 +457,7 @@ class TestCreateLiveImageThread(PungiTestCase):
]) ])
self.assertEqual(run.mock_calls, [mock.call(write_manifest_cmd)]) self.assertEqual(run.mock_calls, [mock.call(write_manifest_cmd)])
self.assertEqual(koji_wrapper.get_create_image_cmd.mock_calls, self.assertEqual(koji_wrapper.get_create_image_cmd.mock_calls,
[mock.call('Test', '20151203.0.t', 'rhel-7.0-candidate', [mock.call('test-Client-Live-amd64', '20151203.0.t', 'rhel-7.0-candidate',
'amd64', '/path/to/ks_file', 'amd64', '/path/to/ks_file',
['/repo/amd64/Client', ['/repo/amd64/Client',
'http://example.com/repo/', 'http://example.com/repo/',
@ -495,6 +504,7 @@ class TestCreateLiveImageThread(PungiTestCase):
'type': 'appliance', 'type': 'appliance',
'ksurl': None, 'ksurl': None,
'release': None, 'release': None,
'subvariant': 'Client',
} }
koji_wrapper = KojiWrapper.return_value koji_wrapper = KojiWrapper.return_value
@ -523,7 +533,7 @@ class TestCreateLiveImageThread(PungiTestCase):
self.assertEqual(run.mock_calls, []) self.assertEqual(run.mock_calls, [])
self.assertEqual(koji_wrapper.get_create_image_cmd.mock_calls, self.assertEqual(koji_wrapper.get_create_image_cmd.mock_calls,
[mock.call('Test', '20151203.0.t', 'rhel-7.0-candidate', [mock.call('test-Client-Disk-amd64', '20151203.0.t', 'rhel-7.0-candidate',
'amd64', '/path/to/ks_file', 'amd64', '/path/to/ks_file',
['/repo/amd64/Client', ['/repo/amd64/Client',
'http://example.com/repo/', 'http://example.com/repo/',
@ -570,6 +580,7 @@ class TestCreateLiveImageThread(PungiTestCase):
'version': None, 'version': None,
'specfile': None, 'specfile': None,
'ksurl': None, 'ksurl': None,
'subvariant': 'Client',
} }
koji_wrapper = KojiWrapper.return_value koji_wrapper = KojiWrapper.return_value
@ -607,6 +618,7 @@ class TestCreateLiveImageThread(PungiTestCase):
'version': None, 'version': None,
'specfile': None, 'specfile': None,
'ksurl': None, 'ksurl': None,
'subvariant': 'Client',
} }
def boom(*args, **kwargs): def boom(*args, **kwargs):

View File

@ -72,6 +72,7 @@ class TestLiveMediaPhase(PungiTestCase):
'title': None, 'title': None,
'install_tree': self.topdir + '/compose/Server/$basearch/os', 'install_tree': self.topdir + '/compose/Server/$basearch/os',
'version': 'Rawhide', 'version': 'Rawhide',
'subvariant': 'Server',
}))]) }))])
@mock.patch('pungi.phases.livemedia_phase.resolve_git_url') @mock.patch('pungi.phases.livemedia_phase.resolve_git_url')
@ -131,6 +132,7 @@ class TestLiveMediaPhase(PungiTestCase):
'title': None, 'title': None,
'install_tree': self.topdir + '/compose/Server/$basearch/os', 'install_tree': self.topdir + '/compose/Server/$basearch/os',
'version': 'Rawhide', 'version': 'Rawhide',
'subvariant': 'Server',
})), })),
mock.call((compose, mock.call((compose,
compose.variants['Server'], compose.variants['Server'],
@ -148,6 +150,7 @@ class TestLiveMediaPhase(PungiTestCase):
'title': None, 'title': None,
'install_tree': self.topdir + '/compose/Server/$basearch/os', 'install_tree': self.topdir + '/compose/Server/$basearch/os',
'version': 'Rawhide', 'version': 'Rawhide',
'subvariant': 'Server',
})), })),
mock.call((compose, mock.call((compose,
compose.variants['Server'], compose.variants['Server'],
@ -165,6 +168,7 @@ class TestLiveMediaPhase(PungiTestCase):
'title': None, 'title': None,
'install_tree': self.topdir + '/compose/Server/$basearch/os', 'install_tree': self.topdir + '/compose/Server/$basearch/os',
'version': '25', 'version': '25',
'subvariant': 'Server',
}))]) }))])
@mock.patch('pungi.phases.livemedia_phase.ThreadPool') @mock.patch('pungi.phases.livemedia_phase.ThreadPool')
@ -234,6 +238,7 @@ class TestLiveMediaPhase(PungiTestCase):
'release': None, 'release': None,
'version': 'Rawhide', 'version': 'Rawhide',
'install_tree_from': 'Everything', 'install_tree_from': 'Everything',
'subvariant': 'Something',
} }
] ]
} }
@ -264,6 +269,7 @@ class TestLiveMediaPhase(PungiTestCase):
'title': 'Custom Title', 'title': 'Custom Title',
'install_tree': self.topdir + '/compose/Everything/$basearch/os', 'install_tree': self.topdir + '/compose/Everything/$basearch/os',
'version': 'Rawhide', 'version': 'Rawhide',
'subvariant': 'Something',
}))]) }))])
@ -290,6 +296,7 @@ class TestLiveMediaThread(PungiTestCase):
'target': 'f24', 'target': 'f24',
'title': None, 'title': None,
'version': 'Rawhide', 'version': 'Rawhide',
'subvariant': 'DATA',
} }
pool = mock.Mock() pool = mock.Mock()
@ -368,6 +375,7 @@ class TestLiveMediaThread(PungiTestCase):
self.assertIn(image.path, image_relative_paths) self.assertIn(image.path, image_relative_paths)
self.assertEqual('iso', image.format) self.assertEqual('iso', image.format)
self.assertEqual('live', image.type) self.assertEqual('live', image.type)
self.assertEqual('DATA', image.subvariant)
@mock.patch('pungi.phases.livemedia_phase.KojiWrapper') @mock.patch('pungi.phases.livemedia_phase.KojiWrapper')
def test_handle_koji_fail(self, KojiWrapper): def test_handle_koji_fail(self, KojiWrapper):