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)
def test_jsoncmp_long(self): fname = self.readable.name cli = ["--json", fname] conf = machinestate.read_cli(cli) self.assertEqual(conf["json"], fname)
def test_output_long(self): fname = "/tmp/machinestate.json" cli = ["--output", fname] conf = machinestate.read_cli(cli) self.assertEqual(conf["output"], fname)
def test_configfile_long(self): cli = ["--configfile", self.readable.name] conf = machinestate.read_cli(cli) self.assertEqual(conf["configfile"], self.readable.name)
def test_anonymous_long(self): cli = ["--anonymous"] conf = machinestate.read_cli(cli) self.assertEqual(conf["anonymous"], True)
def test_sort_long(self): cli = ["--sort"] conf = machinestate.read_cli(cli) self.assertEqual(conf["sort"], True)
def test_extended_long(self): cli = ["--extended"] conf = machinestate.read_cli(cli) self.assertEqual(conf["extended"], True)
def test_executable(self): fname = self.cmd.name cli = [fname] conf = machinestate.read_cli(cli) self.assertEqual(conf["executable"], fname)