def test_repr(self): wrapper = base.ImplementationWrapper(self.dummy, 'state1', base.Transition('foobar', [base.State('foo', 'Foo')], base.State('bar', 'Bar')), None, base.noop) self.assertIn('foobar', repr(wrapper)) self.assertIn('state1', repr(wrapper)) self.assertIn(repr(base.noop), repr(wrapper))
def setUp(self): self.foo = base.State('foo', 'Foo') self.bar = base.State('bar', 'Bar') self.baz = base.State('baz', 'Baz') self.baz2 = base.State('baz', 'Baz') self.foobar = base.Transition('foobar', self.foo, self.bar) self.foobar2 = base.Transition('foobar', self.foo, self.bar) self.gobaz = base.Transition('gobaz', [self.foo, self.bar], self.baz) self.tl = base.TransitionList([self.foobar, self.gobaz])
def test_state_setting(self): class MyWorkflowObject(base.WorkflowEnabled): state = self.MyWorkflow() obj = MyWorkflowObject() self.assertRaises(ValueError, setattr, obj, 'state', base.State('a', 'A'))
def setUp(self): class MyWorkflow(base.Workflow): states = ( ('foo', "Foo"), ('bar', "Bar"), ('baz', "Baz"), ) transitions = ( ('foobar', 'foo', 'bar'), ('gobaz', ('foo', 'bar'), 'baz'), ('bazbar', 'baz', 'bar'), ) initial_state = 'foo' self.foo = base.State('foo', 'Foo') self.bar = base.State('bar', 'Bar') self.wf = MyWorkflow self.sf = base.StateWrapper(self.foo, self.wf) self.sf2 = base.StateWrapper(self.foo, self.wf)
def setUp(self): self.foo = base.State('foo', 'Foo') self.bar = base.State('bar', 'Bar') self.bar2 = base.State('bar', 'Bar') self.sl = base.StateList([self.foo, self.bar])
def test_repr(self): a = base.State('foo', 'Foo') self.assertIn('foo', repr(a)) self.assertNotIn('Foo', repr(a))
def setUp(self): self.foo = base.State('foo', 'Foo') self.bar = base.State('bar', 'Bar') self.baz = base.State('baz', 'Baz') self.foobar = base.Transition('foobar', self.foo, self.bar)
def test_equality(self): self.assertNotEqual(base.State('foo', 'Foo'), base.State('foo', 'Foo'))