summaryrefslogtreecommitdiff
path: root/lib/subunit/python/testtools/tests/test_testsuite.py
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-03-31 03:19:18 +0200
committerJelmer Vernooij <jelmer@samba.org>2010-03-31 03:19:18 +0200
commita8ac7fda573a924debf165d39eff3c1837240d4f (patch)
tree6085df961a5fbcc57a240d7065d2fc4a258cf170 /lib/subunit/python/testtools/tests/test_testsuite.py
parente4af3afd7ae3e39218b42a42d39c2ec10be9a642 (diff)
downloadsamba-a8ac7fda573a924debf165d39eff3c1837240d4f.tar.gz
samba-a8ac7fda573a924debf165d39eff3c1837240d4f.tar.bz2
samba-a8ac7fda573a924debf165d39eff3c1837240d4f.zip
Put testtools directly under lib/ to make it easier to install from Samba 4.
Diffstat (limited to 'lib/subunit/python/testtools/tests/test_testsuite.py')
-rw-r--r--lib/subunit/python/testtools/tests/test_testsuite.py56
1 files changed, 0 insertions, 56 deletions
diff --git a/lib/subunit/python/testtools/tests/test_testsuite.py b/lib/subunit/python/testtools/tests/test_testsuite.py
deleted file mode 100644
index 3f2f02758f..0000000000
--- a/lib/subunit/python/testtools/tests/test_testsuite.py
+++ /dev/null
@@ -1,56 +0,0 @@
-# Copyright (c) 2009 Jonathan M. Lange. See LICENSE for details.
-
-"""Test ConcurrentTestSuite and related things."""
-
-__metaclass__ = type
-
-import unittest
-
-from testtools import (
- ConcurrentTestSuite,
- iterate_tests,
- TestCase,
- )
-from testtools.matchers import (
- Equals,
- )
-from testtools.tests.helpers import LoggingResult
-
-
-class TestConcurrentTestSuiteRun(TestCase):
-
- def test_trivial(self):
- log = []
- result = LoggingResult(log)
- class Sample(TestCase):
- def __hash__(self):
- return id(self)
-
- def test_method1(self):
- pass
- def test_method2(self):
- pass
- test1 = Sample('test_method1')
- test2 = Sample('test_method2')
- original_suite = unittest.TestSuite([test1, test2])
- suite = ConcurrentTestSuite(original_suite, self.split_suite)
- suite.run(result)
- test1 = log[0][1]
- test2 = log[-1][1]
- self.assertIsInstance(test1, Sample)
- self.assertIsInstance(test2, Sample)
- self.assertNotEqual(test1.id(), test2.id())
- # We expect the start/outcome/stop to be grouped
- expected = [('startTest', test1), ('addSuccess', test1),
- ('stopTest', test1), ('startTest', test2), ('addSuccess', test2),
- ('stopTest', test2)]
- self.assertThat(log, Equals(expected))
-
- def split_suite(self, suite):
- tests = list(iterate_tests(suite))
- return tests[0], tests[1]
-
-
-def test_suite():
- from unittest import TestLoader
- return TestLoader().loadTestsFromName(__name__)