def main(): """Parse args, load the user-specified tool and execute it.""" check_dependencies() toolmanager = ToolManager() parser = argparse.ArgumentParser( description="A collection of tools for interacting with MESS.DB", formatter_class=CustomArgparseFormatter ) parser.add_argument( "-v", "--verbose", action="store_true", help=("increase output verbosity to include " "debugging messages") ) toolmanager.populate_parser(parser) args = parser.parse_args() log = Log("console") log.setup(MESS_DIR, args.verbose) log.debug(get_mem_usage()) tool = toolmanager.load_tool(args.subparser_name) tool.execute(args) log.debug(get_mem_usage())
def test_get_mem_usage(self): self.assertRegexpMatches(utils.get_mem_usage(), '.+\d+.+\d+.+\d+.+mb$')