Exemple #1
0
    def testCheckingConditions(self):
        deviceWithoutIcon = Device("A/B/C", None, None)
        deviceWithoutIcon.section = True
        with self.assertRaises(Exception):
            deviceWithoutIcon.checkNecessaryConditions()

        deviceWithoutSection = Device("D/E/F", Icon("test"), None)
        with self.assertRaises(Exception):
            deviceWithoutSection.checkNecessaryConditions()

        deviceWithWrongSubsystem = Device("GHI", Icon("test"), None)
        deviceWithWrongSubsystem.section = True
        with self.assertRaises(Exception):
            deviceWithWrongSubsystem.checkNecessaryConditions()