def test_actions_decorator(self): actions = Actions() @action def my_action(): return 'MyAction' self.assertEqual(actions.my_action(), 'MyAction')
def __init__(self, *args, **kwargs): self.__class__.browsers = [] self.__class__.browser = None super(FunctTestCase, self).__init__(*args, **kwargs) # Makes all actions registered with `@action` accessible by # `self.actions` attribute. self.actions = Actions()
def __init__(self, *args, **kwargs): super(FunctTestCase, self).__init__(*args, **kwargs) # List of browsers to be quitted in tear down. self.browsers = [] # Makes all actions registered with `@action` accessible by # `self.actions` attribute. self.actions = Actions()
def test_undefined_action_raises_AttributeError(self): with self.assertRaises(AttributeError): actions = Actions() actions.undefined_action()