Пример #1
0
 def test_get_pstype_2_psnames_dict(self):
     """Test get_pstype_2_psnames_dict."""
     typ2name = PSSearch.get_pstype_2_psnames_dict()
     self.assertIsInstance(typ2name, dict)
     for pstype, psnames in typ2name.items():
         self.assertIsInstance(pstype, str)
         self.assertIsInstance(psnames, (tuple, list))
         self.assertTrue(len(psnames) > 0)
Пример #2
0
 def function(self):
     """Check PS PwrState."""
     if not self._is_test:
         timeout = 2
     elif self._state == 'on' and \
             ('SI-Fam:PS-B1B2-1' in self._devices or
              'SI-Fam:PS-B1B2-2' in self._devices):
         timeout = 15
     elif self._state == 'off' and \
             (set(_PSSearch.get_pstype_2_psnames_dict()[
                 'as-dclink-regatron-master']) & set(self._devices)):
         timeout = 15
     else:
         timeout = 5
     self._check(method='check_pwrstate',
                 state=self._state,
                 timeout=timeout)