Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
 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)
Exemplo n.º 3
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)
Exemplo n.º 4
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)
Exemplo n.º 5
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)
Exemplo n.º 6
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)
Exemplo n.º 7
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)
Exemplo n.º 8
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)