class TestGlobalEnable(unittest.TestCase): def setUp(self): self.sf = SignalFilter("me") self.invalidEnabler = ~eGlobalEnable.ON assert not eGlobalEnable.isValid(self.invalidEnabler) def testInvalidEnabler(self): item = "hello" try: self.sf.globalEnable(item) except ApiParamError, e: assert e.item == item assert eGlobalEnable in e.allowedTypes assert len(e.allowedTypes) == 1 else: