def test_execute_loader(self): run.execute_loader(TestLoader, sync=True) with db.session_scope() as session: self.assertEqual(session.query(SampleModel).count(), 1) with mock.patch("tests.steps.TestLoader.generate", return_value=[None]): with self.assertRaises(TypeError): run.execute_loader(TestLoader, sync=True)
def test_execute_no_loader(self): with self.assertRaises(TypeError): run.execute_loader("foo", sync=True)
def test_procces_corectly_created(self, *args): with mock.patch("tests.steps.TestLoader.procno", 20): procs = run.execute_loader(TestLoader) self.assertEqual(len(procs), 20)