Пример #1
0
 def test_emptyCli(self):
     cli = []
     conf = machinestate.read_cli(cli)
     self.assertEqual(conf["extended"], False)
     self.assertEqual(conf["sort"], False)
     self.assertEqual(conf["anonymous"], False)
     self.assertEqual(conf["config"], False)
     self.assertEqual(conf["configfile"], None)
     self.assertEqual(conf["json"], None)
     self.assertEqual(conf["output"], None)
     self.assertEqual(conf["executable"], None)
     self.assertEqual(conf["indent"], 4)
Пример #2
0
 def test_jsoncmp_long(self):
     fname = self.readable.name
     cli = ["--json", fname]
     conf = machinestate.read_cli(cli)
     self.assertEqual(conf["json"], fname)
Пример #3
0
 def test_output_long(self):
     fname = "/tmp/machinestate.json"
     cli = ["--output", fname]
     conf = machinestate.read_cli(cli)
     self.assertEqual(conf["output"], fname)
Пример #4
0
 def test_configfile_long(self):
     cli = ["--configfile", self.readable.name]
     conf = machinestate.read_cli(cli)
     self.assertEqual(conf["configfile"], self.readable.name)
Пример #5
0
 def test_anonymous_long(self):
     cli = ["--anonymous"]
     conf = machinestate.read_cli(cli)
     self.assertEqual(conf["anonymous"], True)
Пример #6
0
 def test_sort_long(self):
     cli = ["--sort"]
     conf = machinestate.read_cli(cli)
     self.assertEqual(conf["sort"], True)
Пример #7
0
 def test_extended_long(self):
     cli = ["--extended"]
     conf = machinestate.read_cli(cli)
     self.assertEqual(conf["extended"], True)
Пример #8
0
 def test_executable(self):
     fname = self.cmd.name
     cli = [fname]
     conf = machinestate.read_cli(cli)
     self.assertEqual(conf["executable"], fname)