def test_sysbottle_run(self): """validates we don't get a bad exit code""" parser = argparse.ArgumentParser( prog="sysbottle", description="sysbottle is parsed" ) subparsers = parser.add_subparsers() sysbottle.build(subparsers) test_file_1 = os.path.join(current_dir(__file__), "..", "testdata", "iostat") args = parser.parse_args( [ "sysbottle", test_file_1, "-c", "90", "-q", "1", "-d", "sda", "-i", "5", "-t", "3", ] ) sysbottle.run(args)
def test_args(self): """verify schema args are wired up correctly""" parser = argparse.ArgumentParser( prog="sysbottle", description="sysbottle is parsed" ) subparsers = parser.add_subparsers() sysbottle.build(subparsers) args = parser.parse_args( [ "sysbottle", "abc.txt", "-c", "90", "-q", "1", "-d", "sda", "-i", "5", "-t", "3", ] ) self.assertTrue(hasattr(args, "file")) self.assertTrue(hasattr(args, "cpu")) self.assertTrue(hasattr(args, "diskQ")) self.assertTrue(hasattr(args, "disks")) self.assertTrue(hasattr(args, "iowait")) self.assertTrue(hasattr(args, "throughput"))
def build_parser(): """build the parser that wires up the subcommands and their flags""" parser, subparsers = _build_sperf_cmd() core.build(subparsers) search.build(subparsers) sysbottle.build(subparsers) ttop.build(subparsers) return parser
def test_sysbottle_run(): """validates we don't get a bad exit code""" parser = argparse.ArgumentParser(prog="mine", description="entry point") subparsers = parser.add_subparsers() sysbottle.build(subparsers) test_file_1 = os.path.join(current_dir(__file__), '..', 'testdata', 'iostat') args = parser.parse_args(["sysbottle", test_file_1, "-c", "90", "-q", "1", "-d", "sda", "-i", "5", "-t", "3"]) sysbottle.run(args)