summaryrefslogtreecommitdiff
path: root/selftest/tests
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2012-03-04 18:00:54 +0100
committerJelmer Vernooij <jelmer@samba.org>2012-03-04 19:38:25 +0100
commitc9d380702cb8d1b2d393d7c369ec27adf4bb1060 (patch)
tree18f11d55e881f4edf6fad99ab6abc977c038c235 /selftest/tests
parent82af4a79b9c86c5c055158ab629a243e41c53249 (diff)
downloadsamba-c9d380702cb8d1b2d393d7c369ec27adf4bb1060.tar.gz
samba-c9d380702cb8d1b2d393d7c369ec27adf4bb1060.tar.bz2
samba-c9d380702cb8d1b2d393d7c369ec27adf4bb1060.zip
selftest.py: Use testtools TestCase class.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Sun Mar 4 19:38:25 CET 2012 on sn-devel-104
Diffstat (limited to 'selftest/tests')
-rw-r--r--selftest/tests/__init__.py2
-rw-r--r--selftest/tests/test_socket_wrapper.py5
-rw-r--r--selftest/tests/test_target.py8
-rw-r--r--selftest/tests/test_testlist.py12
4 files changed, 15 insertions, 12 deletions
diff --git a/selftest/tests/__init__.py b/selftest/tests/__init__.py
index 12bcf43b9b..3de290c89c 100644
--- a/selftest/tests/__init__.py
+++ b/selftest/tests/__init__.py
@@ -19,6 +19,8 @@
"""Tests for selftest."""
+from testtools import TestCase
+
import unittest
def test_suite():
diff --git a/selftest/tests/test_socket_wrapper.py b/selftest/tests/test_socket_wrapper.py
index 1ebdf94de1..81fe5b603c 100644
--- a/selftest/tests/test_socket_wrapper.py
+++ b/selftest/tests/test_socket_wrapper.py
@@ -19,12 +19,13 @@
"""Tests for selftest/socket_wrapper."""
+from selftest.tests import TestCase
+
from selftest import socket_wrapper
import os
-import unittest
-class SocketWrapperTests(unittest.TestCase):
+class SocketWrapperTests(TestCase):
def test_setup_pcap(self):
socket_wrapper.setup_pcap("somefile")
diff --git a/selftest/tests/test_target.py b/selftest/tests/test_target.py
index 139ed741d0..4cdc02884b 100644
--- a/selftest/tests/test_target.py
+++ b/selftest/tests/test_target.py
@@ -29,7 +29,7 @@ from selftest.target import (
UnsupportedEnvironment,
)
-import unittest
+from selftest.tests import TestCase
class DummyEnvironment(Environment):
@@ -53,7 +53,7 @@ class DummyTarget(Target):
return DummyEnvironment(name, prefix)
-class NoneEnvironmentTests(unittest.TestCase):
+class NoneEnvironmentTests(TestCase):
def setUp(self):
super(NoneEnvironmentTests, self).setUp()
@@ -69,7 +69,7 @@ class NoneEnvironmentTests(unittest.TestCase):
self.assertEquals("", self.env.get_log())
-class NoneTargetTests(unittest.TestCase):
+class NoneTargetTests(TestCase):
def setUp(self):
super(NoneTargetTests, self).setUp()
@@ -80,7 +80,7 @@ class NoneTargetTests(unittest.TestCase):
"something", "prefx")
-class EnvironmentManagerTests(unittest.TestCase):
+class EnvironmentManagerTests(TestCase):
def setUp(self):
super(EnvironmentManagerTests, self).setUp()
diff --git a/selftest/tests/test_testlist.py b/selftest/tests/test_testlist.py
index 4405e86003..cd44d46238 100644
--- a/selftest/tests/test_testlist.py
+++ b/selftest/tests/test_testlist.py
@@ -19,6 +19,8 @@
"""Tests for selftest.testlist."""
+from selftest.tests import TestCase
+
from selftest.testlist import (
RestrictedTestManager,
find_in_list,
@@ -28,10 +30,8 @@ from selftest.testlist import (
from cStringIO import StringIO
-import unittest
-
-class FindInListTests(unittest.TestCase):
+class FindInListTests(TestCase):
def test_empty(self):
self.assertIs(None, find_in_list([], "foo.test"))
@@ -41,7 +41,7 @@ class FindInListTests(unittest.TestCase):
find_in_list([("foo.*bar", "because")], "foo.bla.bar"))
-class ReadTestRegexesTests(unittest.TestCase):
+class ReadTestRegexesTests(TestCase):
def test_comment(self):
f = StringIO("# I am a comment\n # I am also a comment\n")
@@ -57,7 +57,7 @@ class ReadTestRegexesTests(unittest.TestCase):
list(read_test_regexes(f)))
-class ReadTestlistTests(unittest.TestCase):
+class ReadTestlistTests(TestCase):
def test_read_list(self):
inf = StringIO("-- TEST --\nfoo\nbar\nbla\n")
@@ -75,7 +75,7 @@ class ReadTestlistTests(unittest.TestCase):
-class RestrictedTestManagerTests(unittest.TestCase):
+class RestrictedTestManagerTests(TestCase):
def test_unused(self):
mgr = RestrictedTestManager(["foo.bar"])