summaryrefslogtreecommitdiff
path: root/src/leap/testing/basetest.py
diff options
context:
space:
mode:
authorantialias <antialias@leap.se>2012-08-22 12:01:20 -0700
committerantialias <antialias@leap.se>2012-08-22 12:01:20 -0700
commit5b5104604155068992a7939ebb6df034ba374e45 (patch)
tree4b4ab9d1fa96a4b6fb60f76e553ddc1f47c97e88 /src/leap/testing/basetest.py
parent5d848fe4f127ea01615102e6d8f14bfb12dfe2da (diff)
parent1da2cf6bbc64bfc624ea6fed9beb83d301f308d1 (diff)
Merge branch 'develop' of ssh://leap.se:4422/leap-client into get-definition.json
Diffstat (limited to 'src/leap/testing/basetest.py')
-rw-r--r--src/leap/testing/basetest.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/leap/testing/basetest.py b/src/leap/testing/basetest.py
new file mode 100644
index 00000000..ccf1a76f
--- /dev/null
+++ b/src/leap/testing/basetest.py
@@ -0,0 +1,37 @@
+import os
+import shutil
+import tempfile
+
+try:
+ import unittest2 as unittest
+except ImportError:
+ import unittest
+
+
+class BaseLeapTest(unittest.TestCase):
+
+ __name__ = "leap_test"
+
+ @classmethod
+ def setUpClass(cls):
+ cls.old_path = os.environ['PATH']
+ cls.tempdir = tempfile.mkdtemp()
+ bin_tdir = os.path.join(
+ cls.tempdir,
+ 'bin')
+ os.environ["PATH"] = bin_tdir
+
+ @classmethod
+ def tearDownClass(cls):
+ os.environ["PATH"] = cls.old_path
+ shutil.rmtree(cls.tempdir)
+
+ def setUp(self):
+ raise NotImplementedError("abstract base class")
+
+ def tearDown(self):
+ raise NotImplementedError("abstract base class")
+
+
+if __name__ == "__main__":
+ unittest.main()