Added a verbosity option and banner to osmotestvty

This commit is contained in:
Kat 2013-04-05 18:21:39 +02:00
parent a8ee6bb97b
commit 0d114c854b
2 changed files with 10 additions and 1 deletions

2
osmopy/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*.pyc
*.swp

View File

@ -65,12 +65,18 @@ if __name__ == '__main__':
confpath = "."
parser = argparse.ArgumentParser()
parser.add_argument("-v", "--verbose", dest="verbose",
action="store_true", help="verbose mode")
parser.add_argument("-p", "--pythonconfpath", dest="p",
help="searchpath for config")
parser.add_argument("-w", "--workdir", dest="w",
help="Working directory to run in")
args = parser.parse_args()
verbose_level = 1
if args.verbose:
verbose_level = 2
if args.w:
workdir = args.w
@ -84,6 +90,7 @@ if __name__ == '__main__':
sys.exit(1)
os.chdir(workdir)
print "Running tests for specific VTY commands"
suite = unittest.TestLoader().loadTestsFromTestCase(TestVTY)
res = unittest.TextTestRunner(verbosity=1).run(suite)
res = unittest.TextTestRunner(verbosity=verbose_level).run(suite)
sys.exit(len(res.errors) + len(res.failures))