summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMartin Sivak <msivak@redhat.com>2010-05-31 15:09:31 +0200
committerWill Woods <wwoods@redhat.com>2011-02-14 11:13:57 -0500
commit10f663b75120dd5107361fd21d3010d4907a1ffe (patch)
tree2df3321ee4f5330884fbf5af162379253e48df87 /tests
parentd38f3ae2d90be7e884d44190ade6663c97a07bca (diff)
downloadanaconda-10f663b75120dd5107361fd21d3010d4907a1ffe.tar.gz
anaconda-10f663b75120dd5107361fd21d3010d4907a1ffe.tar.xz
anaconda-10f663b75120dd5107361fd21d3010d4907a1ffe.zip
Tag tests as slow or acceptance tests and split full testing from devel unit testing
Diffstat (limited to 'tests')
-rw-r--r--tests/kickstart_test/commands_test.py11
-rw-r--r--tests/mock/__init__.py10
-rwxr-xr-xtests/storage_test/devicelibs_test/crypto_test.py4
-rwxr-xr-xtests/storage_test/devicelibs_test/lvm_test.py4
-rwxr-xr-xtests/storage_test/devicelibs_test/mdraid_test.py3
-rwxr-xr-xtests/storage_test/devicelibs_test/mpath_test.py3
-rwxr-xr-xtests/storage_test/devicelibs_test/swap_test.py3
7 files changed, 32 insertions, 6 deletions
diff --git a/tests/kickstart_test/commands_test.py b/tests/kickstart_test/commands_test.py
index 9001cc073..6d472b98c 100644
--- a/tests/kickstart_test/commands_test.py
+++ b/tests/kickstart_test/commands_test.py
@@ -18,7 +18,7 @@
# Author: Chris Lumens <clumens@redhat.com>
import unittest
import sys
-from mock import Mock, patch, TestCase
+from mock import Mock, patch, TestCase, acceptance
class O(object):
pass
@@ -60,9 +60,9 @@ class CommandVersionTestCase(TestCase):
def tearDown(self):
self.tearDownModules()
- def runTest(self):
- from pyanaconda import kickstart
+ @acceptance
+ def commands_test(self):
for (commandName, commandObj) in kickstart.commandMap.iteritems():
baseClass = commandObj().__class__.__bases__[0]
pykickstartClass = self.handler.commands[commandName].__class__
@@ -79,9 +79,8 @@ class DataVersionTestCase(unittest.TestCase):
self.handler = pykickstart.version.makeVersion(kickstart.ver)
- def runTest(self):
- from pyanaconda import kickstart
-
+ @acceptance
+ def data_test(self):
for (dataName, dataObj) in kickstart.dataMap.iteritems():
baseClass = dataObj().__class__.__bases__[0]
diff --git a/tests/mock/__init__.py b/tests/mock/__init__.py
index 8c35c9c51..fb9dd0725 100644
--- a/tests/mock/__init__.py
+++ b/tests/mock/__init__.py
@@ -24,6 +24,16 @@ from disk import *
from mock import *
import unittest
+def slow(f):
+ """Decorates a test method as being slow, usefull for python-nose filtering"""
+ f.slow = True
+ return f
+
+def acceptance(f):
+ """Decorates test as belonging to acceptance testing and not useable in common devellopment unit testing. To be used with python-nose filtering."""
+ f.acceptance = True
+ return f
+
class TestCase(unittest.TestCase):
def __init__(self, *args, **kwargs):
unittest.TestCase.__init__(self, *args, **kwargs)
diff --git a/tests/storage_test/devicelibs_test/crypto_test.py b/tests/storage_test/devicelibs_test/crypto_test.py
index dd05af284..3e9e3a667 100755
--- a/tests/storage_test/devicelibs_test/crypto_test.py
+++ b/tests/storage_test/devicelibs_test/crypto_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
import baseclass
import unittest
+from mock import acceptance
import tempfile
import os
@@ -13,6 +14,9 @@ class CryptoTestCase(baseclass.DevicelibsTestCase):
import storage.devicelibs.crypto as crypto
+
+ @acceptance
+ def testCrypto(self):
##
## is_luks
##
diff --git a/tests/storage_test/devicelibs_test/lvm_test.py b/tests/storage_test/devicelibs_test/lvm_test.py
index e81e529cc..e639a2137 100755
--- a/tests/storage_test/devicelibs_test/lvm_test.py
+++ b/tests/storage_test/devicelibs_test/lvm_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
import baseclass
import unittest
+from mock import acceptance
class LVMTestCase(baseclass.DevicelibsTestCase):
@@ -10,6 +11,9 @@ class LVMTestCase(baseclass.DevicelibsTestCase):
import storage.devicelibs.lvm as lvm
+
+ @acceptance
+ def testLVM(self):
##
## pvcreate
##
diff --git a/tests/storage_test/devicelibs_test/mdraid_test.py b/tests/storage_test/devicelibs_test/mdraid_test.py
index 1f7849ec5..9083bd162 100755
--- a/tests/storage_test/devicelibs_test/mdraid_test.py
+++ b/tests/storage_test/devicelibs_test/mdraid_test.py
@@ -2,6 +2,7 @@
import baseclass
import unittest
import time
+from mock import acceptance
class MDRaidTestCase(baseclass.DevicelibsTestCase):
@@ -11,6 +12,8 @@ class MDRaidTestCase(baseclass.DevicelibsTestCase):
import storage.devicelibs.mdraid as mdraid
+ @acceptance
+ def testMDRaid(self):
##
## getRaidLevels
##
diff --git a/tests/storage_test/devicelibs_test/mpath_test.py b/tests/storage_test/devicelibs_test/mpath_test.py
index 377b50d64..565d1fa36 100755
--- a/tests/storage_test/devicelibs_test/mpath_test.py
+++ b/tests/storage_test/devicelibs_test/mpath_test.py
@@ -1,11 +1,14 @@
#!/usr/bin/python
import baseclass
import unittest
+from mock import acceptance
class MPathTestCase(baseclass.DevicelibsTestCase):
def testMPath(self):
import storage.devicelibs.mpath as mpath
+ @acceptance
+ def testMPath(self):
##
## parseMultipathOutput
##
diff --git a/tests/storage_test/devicelibs_test/swap_test.py b/tests/storage_test/devicelibs_test/swap_test.py
index 68f778d38..3808943cc 100755
--- a/tests/storage_test/devicelibs_test/swap_test.py
+++ b/tests/storage_test/devicelibs_test/swap_test.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
import baseclass
import unittest
+from mock import acceptance
class SwapTestCase(baseclass.DevicelibsTestCase):
@@ -10,6 +11,8 @@ class SwapTestCase(baseclass.DevicelibsTestCase):
import storage.devicelibs.swap as swap
+ @acceptance
+ def testSwap(self):
##
## mkswap
##