def test_runCommandHelp(self): """Ensure main entry point with no args completes.""" with self.assertRaises(SystemExit) as excinfo: # have to override the pytest args sys.argv = [""] main() self.assertEqual(excinfo.exception.code, 0)
def test_executeCommand(self): """use executeCommand to call run, But we expect it to fail because we provide a fictional settings YAML """ with self.assertRaises(SystemExit) as excinfo: # override the pytest args sys.argv = ["run", "path/to/fake.yaml"] main() self.assertEqual(excinfo.exception.code, 1)
def test_main(self): with self.assertRaises(SystemExit): main()