From 628af2f9738c42490424bb36f217884d4ab07a7f Mon Sep 17 00:00:00 2001 From: Hugo Trippaers Date: Fri, 14 Nov 2014 12:28:02 +0100 Subject: [PATCH] Get started with some tests on the python code --- systemvm/test/python/TestCsAddress.py | 16 ++++++++++++++++ systemvm/test/python/runtests.sh | 8 ++++++++ 2 files changed, 24 insertions(+) create mode 100644 systemvm/test/python/TestCsAddress.py create mode 100644 systemvm/test/python/runtests.sh diff --git a/systemvm/test/python/TestCsAddress.py b/systemvm/test/python/TestCsAddress.py new file mode 100644 index 00000000000..f4430aeaa55 --- /dev/null +++ b/systemvm/test/python/TestCsAddress.py @@ -0,0 +1,16 @@ +import unittest +from cs.CsAddress import CsAddress +import merge + + +class TestCsAddress(unittest.TestCase): + + def setUp(self): + merge.dataBag.DPATH = "." + + def test_needs_vrrp(self): + csaddress = CsAddress("ips", {}) + self.assertTrue(csaddress.needs_vrrp({"nw_type": "public"})) + +if __name__ == '__main__': + unittest.main() diff --git a/systemvm/test/python/runtests.sh b/systemvm/test/python/runtests.sh new file mode 100644 index 00000000000..be090b3d970 --- /dev/null +++ b/systemvm/test/python/runtests.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +# requires netaddr + +export PYTHONPATH="../../patches/debian/config/opt/cloud/bin/" +export PYTHONDONTWRITEBYTECODE=False + +nosetests .