def test_structure_2_missing_system(self): images = { 'kickstart': ['/path/to/kickstart_image.bin'] } with self.assertRaises(Exception): ImageHandler(self.device, images)
def test_structure_1_missing_entry(self): images = [ '/path/to/kickstart_image.bin', ] with self.assertRaises(Exception): ImageHandler(self.device, images)
def test_structure_2_extra_type(self): images = { 'kickstart': ['/path/to/kickstart_image.bin'], 'system': ['/path/to/system_image.bin'], 'this shouldnt work': ['/path/to/system_image.bin'] } with self.assertRaises(Exception): ImageHandler(self.device, images)
def test_structure_1_extra_entry(self): images = [ '/path/to/kickstart_image.bin', '/path/to/system_image.bin', 'invalid entry' ] with self.assertRaises(Exception): ImageHandler(self.device, images)
def test_structure_3_missing_kickstart(self): images = { 'system': { 'file': ['/path/to/system_image.bin'] } } with self.assertRaises(Exception): ImageHandler(self.device, images)
def test_structure_2(self): images = { 'kickstart': [self.KICKSTART_IMAGE], 'system': [self.SYSTEM_IMAGE] } image_handler = ImageHandler(self.device, images) self.assertEqual(image_handler.kickstart, self.EXPECTED_KICKSTART) self.assertEqual(image_handler.system, self.EXPECTED_SYSTEM)