def test_sperf_will_break_if_incorrect_comamnd_is_used(self): """this is here so we can rely on the parser tests for subcommands tests being accurate""" parser = sperf.build_parser() success = False try: parser.parse_args(["nevergonnabereal"]) except SystemExit as e: success = True self.assertEqual(str(e), "2") self.assertTrue(success)
def test_sysbottle_wired(self): """verify sysbottle is connected""" parser = sperf.build_parser() args = parser.parse_args(["sysbottle", "iostat.txt"]) self.assertTrue(hasattr(args, "func"))
def test_solrqueryagg_wired(self): """verify solrqueryagg is connected""" parser = sperf.build_parser() args = parser.parse_args(["search", "queryscore"]) self.assertTrue(hasattr(args, "func"))
def test_slowquery_wired(self): """verify slowquery is connected""" parser = sperf.build_parser() args = parser.parse_args(["core", "slowquery"]) self.assertTrue(hasattr(args, "func"))
def test_jarcheck_wired(self): """verify jarcheck is connected""" parser = sperf.build_parser() args = parser.parse_args(["core", "jarcheck"]) self.assertTrue(hasattr(args, "func"))
def test_search_filtercache_wired(self): """verify filtercache is connected""" parser = sperf.build_parser() args = parser.parse_args(["search", "filtercache"]) self.assertTrue(hasattr(args, "func"))
def test_core_diag_wired(self): """verify cassread is connected""" parser = sperf.build_parser() args = parser.parse_args(["core", "diag"]) self.assertTrue(hasattr(args, "func"))
def test_sperf_global_short_flags(self): """tests the global short flag""" parser = sperf.build_parser() args = parser.parse_args(["-v", "-x"]) self.assertTrue(hasattr(args, "debug")) self.assertTrue(hasattr(args, "noprogress"))
def test_sperf_global_flags(self): """testing global flags are wired up""" parser = sperf.build_parser() args = parser.parse_args(["--debug", "--no-progress"]) self.assertTrue(hasattr(args, "debug")) self.assertTrue(hasattr(args, "noprogress"))
def test_schema_wired(): """verify schema is connected""" parser = sperf.build_parser() args = parser.parse_args(["core", "schema"]) assert hasattr(args, "func")
def test_sperf_global_short_flags(): """tests the global short flag""" parser = sperf.build_parser() args = parser.parse_args(["-v", "-p"]) assert hasattr(args, "debug") assert hasattr(args, "progress")
def test_sperf_global_flags(): """testing global flags are wired up""" parser = sperf.build_parser() args = parser.parse_args(["--debug", "--progress"]) assert hasattr(args, "debug") assert hasattr(args, "progress")