diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2012-03-04 18:00:54 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2012-03-04 19:38:25 +0100 |
commit | c9d380702cb8d1b2d393d7c369ec27adf4bb1060 (patch) | |
tree | 18f11d55e881f4edf6fad99ab6abc977c038c235 /selftest/tests | |
parent | 82af4a79b9c86c5c055158ab629a243e41c53249 (diff) | |
download | samba-c9d380702cb8d1b2d393d7c369ec27adf4bb1060.tar.gz |
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__.py | 2 | ||||
-rw-r--r-- | selftest/tests/test_socket_wrapper.py | 5 | ||||
-rw-r--r-- | selftest/tests/test_target.py | 8 | ||||
-rw-r--r-- | selftest/tests/test_testlist.py | 12 |
4 files changed, 15 insertions, 12 deletions
diff --git a/selftest/tests/__init__.py b/selftest/tests/__init__.py index 12bcf43b9b4..3de290c89c7 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 1ebdf94de17..81fe5b603cf 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 139ed741d0e..4cdc02884b7 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 4405e860031..cd44d462381 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"]) |