mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
ab7ace6aa5
Integration tests requiring a salt master and daemon were seperated from pure unit tests. For now both are run with runtest.py. In the future it could take arguments for which type of tests to run.
34 lines
1000 B
Python
34 lines
1000 B
Python
"""
|
|
This file provides a single interface to unittest objects for our
|
|
tests while supporting python < 2.7 via unittest2.
|
|
|
|
If you need something from the unittest namespace it should be
|
|
imported here from the relevant module and then imported into your
|
|
test from here
|
|
"""
|
|
|
|
# Import python libs
|
|
import os
|
|
import sys
|
|
|
|
# support python < 2.7 via unittest2
|
|
if sys.version_info[0:2] < (2,7):
|
|
try:
|
|
from unittest2 import TestLoader, TextTestRunner,\
|
|
TestCase, expectedFailure, \
|
|
TestSuite
|
|
except ImportError:
|
|
print "You need to install unittest2 to run the salt tests"
|
|
sys.exit(1)
|
|
else:
|
|
from unittest import TestLoader, TextTestRunner,\
|
|
TestCase, expectedFailure, \
|
|
TestSuite
|
|
|
|
# Set up paths
|
|
TEST_DIR = os.path.dirname(os.path.normpath(os.path.abspath(__file__)))
|
|
SALT_LIBS = os.path.dirname(TEST_DIR)
|
|
|
|
sys.path.insert(0, TEST_DIR)
|
|
sys.path.insert(0, SALT_LIBS)
|