def test_with_incorrect_args(self): """Run the service with options not set correctly""" with self.assertRaises(SystemExit) as se: Service.run(["-l"]) self.assertNotEqual(se.exception.code, 0) with self.assertRaises(SystemExit) as se: Service.run(["opt1", "opt2"]) self.assertNotEqual(se.exception.code, 0)
def test_with_inexistant_configuration(self): """Run the service with a missing configuration file""" with self.assertRaises(SystemExit) as se: Service.run(["/non/existant/config/file.yaml"]) self.assertNotEqual(se.exception.code, 0)
def test_with_unknown_args(self): """Run the service with incorrect args""" with self.assertRaises(SystemExit) as se: Service.run(["-y", "squid"]) self.assertNotEqual(se.exception.code, 0)
def test_without_args(self): """Run the service without arguments""" with self.assertRaises(SystemExit) as se: Service.run([]) self.assertNotEqual(se.exception.code, 0)