Exemplo n.º 1
0
 def test_reset_context(self):
     workflow_id1 = uuid4()
     context1 = {'workflow_execution_id': workflow_id1}
     app1 = AppBase('Something', self.device2.id, context1)
     app1._cache = self.cache
     workflow_id2 = uuid4()
     context2 = {'workflow_execution_id': workflow_id2}
     app2 = AppBase('Something', self.device2.id, context2)
     app2._cache = self.cache
     app1.foo = 42
     app1.bar = 'abc'
     app2.foo = 43
     app2.bar = 'def'
     app1._reset_context(context2)
     self.assertEqual(app1.foo, 43)
     self.assertEqual(app1.bar, 'def')
Exemplo n.º 2
0
 def test_reset_context(self):
     workflow_id1 = uuid4()
     context1 = {'workflow_execution_id': workflow_id1}
     app1 = AppBase('Something', self.device2.id, context1)
     app1._cache = self.cache
     workflow_id2 = uuid4()
     context2 = {'workflow_execution_id': workflow_id2}
     app2 = AppBase('Something', self.device2.id, context2)
     app2._cache = self.cache
     app1.foo = 42
     app1.bar = 'abc'
     app2.foo = 43
     app2.bar = 'def'
     app1._reset_context(context2)
     self.assertEqual(app1.foo, 43)
     self.assertEqual(app1.bar, 'def')