Ejemplo n.º 1
0
 def _foreachPlatform(self, *args, **kwargs):
     code = kwargs.get('code', 0)
     loadPlatforms()
     for platform in getPlatforms():
         key = platform.SID[0] if platform.SID else platform.SKU[0]
         args = ['-p', key, '-s'] + list(args)
         self._runMain(args, code)
Ejemplo n.º 2
0
    def testPlatformInstance(self):
        platform.loadPlatforms()

        for cls in platform.getPlatforms():
            if not issubclass(cls, FixedSystem):
                continue
            cls()
Ejemplo n.º 3
0
    def testPlatformInfo(self):
        platform.loadPlatforms()

        for cls in platform.getPlatforms():
            self.assertIsInstance(cls.PLATFORM, (type(None), str))
            self.assertIsInstance(cls.SID, list)
            self.assertIsInstance(cls.SKU, list)
Ejemplo n.º 4
0
 def setUpClass(cls):
     cls.logger = getLogger(cls.__name__)
     cls.inventories = {}
     for name, platform in getPlatforms().items():
         assert platform
         cls.logger.info('Testing init for platform %s', name)
         platformObj = platform()
         assert platformObj
         cls.logger.info('Setting inventory for platform %s', name)
         inventory = platformObj.getInventory()
         assert inventory
         cls.inventories[name] = inventory
     cls.ledColors = ['off', 'green', 'red', 'yellow']
Ejemplo n.º 5
0
 def testSetup(self):
     for name, platform in getPlatforms().items():
         self.logger.info('Testing setup for platform %s', name)
         platform = platform()
         platform.setup()