def test_runs_subaction(self): pipe = Pipeline() pipe.add_action(self.sub0) pipe.add_action(self.sub1) pipe.run_actions(None, None) self.assertTrue(self.sub0.ran) self.assertTrue(self.sub1.ran) self.assertNotEqual(self.sub0.timeout.elapsed_time, 0) self.assertNotEqual(self.sub1.timeout.elapsed_time, 0)
def test_change_connection(self): pipe = Pipeline() pipe.add_action(TestFakeActions.MakeNewConnection()) conn = object() self.assertIsNot(conn, pipe.run_actions(conn, None))
def test_keep_connection(self): pipe = Pipeline() pipe.add_action(TestFakeActions.KeepConnection()) conn = object() self.assertIs(conn, pipe.run_actions(conn, None))