aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKat <katerinab@gmail.com>2013-04-05 18:21:39 +0200
committerKat <katerinab@gmail.com>2013-04-05 18:21:39 +0200
commit0d114c854b022e3f34e20ae6e92de8e18ca790af (patch)
treea9414d9fdf615e18b34a27c32d1b37a699c0fcc4
parenta8ee6bb97bc0987c93abddcd092d0d4a48bbe5cf (diff)
Added a verbosity option and banner to osmotestvty
-rw-r--r--osmopy/.gitignore2
-rwxr-xr-xosmopy/osmotestvty.py9
2 files changed, 10 insertions, 1 deletions
diff --git a/osmopy/.gitignore b/osmopy/.gitignore
new file mode 100644
index 0000000..c9b568f
--- /dev/null
+++ b/osmopy/.gitignore
@@ -0,0 +1,2 @@
+*.pyc
+*.swp
diff --git a/osmopy/osmotestvty.py b/osmopy/osmotestvty.py
index 2ee877a..0f685d6 100755
--- a/osmopy/osmotestvty.py
+++ b/osmopy/osmotestvty.py
@@ -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))