Example #1
0
    def test_structure_2_extra_type(self):
        images = {
            '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_3_missing_entry(self):
        images = {
            'system': {
                'this shouldnt work': ['/path/to/system_image.bin']
            }
        }

        with self.assertRaises(Exception):
            ImageHandler(self.device, images)
Example #3
0
    def test_structure_1_missing_entry(self):
        images = []

        with self.assertRaises(Exception):
            ImageHandler(self.device, images)
Example #4
0
    def test_structure_1_extra_entry(self):
        images = ['/path/to/system_image.bin', 'invalid entry']

        with self.assertRaises(Exception):
            ImageHandler(self.device, images)
Example #5
0
    def test_structure_3(self):
        images = {'system': {'file': [self.SYSTEM_IMAGE]}}

        image_handler = ImageHandler(self.device, images)

        self.assertEqual(image_handler.system, self.EXPECTED_SYSTEM)
Example #6
0
    def test_structure_1(self):
        images = [self.SYSTEM_IMAGE]

        image_handler = ImageHandler(self.device, images)

        self.assertEqual(image_handler.system, self.EXPECTED_SYSTEM)