922
922
self.assertEqual(
924
('update', '[2 in 0s, 3 known failures] passing_test', None, None),
924
('update', '[2 in 0s] passing_test', None, None),
998
998
self.assertEqual(
1000
('update', '[2 in 0s, 2 missing features] passing_test', None, None),
1000
('update', '[2 in 0s, 2 missing] passing_test', None, None),
1964
1964
'mod1.submod1',
1965
1965
'mod1.submod2.cl1.meth1', 'mod1.submod2.cl2.meth2',
1967
self.assertTrue(id_list.is_module_name_used('mod1'))
1968
self.assertTrue(id_list.is_module_name_used('mod1.submod1'))
1969
self.assertTrue(id_list.is_module_name_used('mod1.submod2'))
1970
self.assertTrue(id_list.test_in('mod1.cl1.meth1'))
1971
self.assertTrue(id_list.test_in('mod1.submod1'))
1972
self.assertTrue(id_list.test_in('mod1.func1'))
1967
self.assertTrue(id_list.refers_to('mod1'))
1968
self.assertTrue(id_list.refers_to('mod1.submod1'))
1969
self.assertTrue(id_list.refers_to('mod1.submod2'))
1970
self.assertTrue(id_list.includes('mod1.cl1.meth1'))
1971
self.assertTrue(id_list.includes('mod1.submod1'))
1972
self.assertTrue(id_list.includes('mod1.func1'))
1974
1974
def test_bad_chars_in_params(self):
1975
1975
id_list = self._create_id_list(['mod1.cl1.meth1(xx.yy)'])
1976
self.assertTrue(id_list.is_module_name_used('mod1'))
1977
self.assertTrue(id_list.test_in('mod1.cl1.meth1(xx.yy)'))
1976
self.assertTrue(id_list.refers_to('mod1'))
1977
self.assertTrue(id_list.includes('mod1.cl1.meth1(xx.yy)'))
1979
1979
def test_module_used(self):
1980
1980
id_list = self._create_id_list(['mod.class.meth'])
1981
self.assertTrue(id_list.is_module_name_used('mod'))
1982
self.assertTrue(id_list.is_module_name_used('mod.class'))
1983
self.assertTrue(id_list.is_module_name_used('mod.class.meth'))
1981
self.assertTrue(id_list.refers_to('mod'))
1982
self.assertTrue(id_list.refers_to('mod.class'))
1983
self.assertTrue(id_list.refers_to('mod.class.meth'))
1985
1985
def test_test_suite(self):
1986
1986
# This test is slow, so we do a single test with one test in each
2059
2059
self.assertEquals('bar baz', tlist[3])
2062
class TestFilteredByModuleTestLoader(tests.TestCase):
2064
def _create_loader(self, test_list):
2065
id_filter = tests.TestIdList(test_list)
2066
loader = TestUtil.FilteredByModuleTestLoader(id_filter.refers_to)
2069
def test_load_tests(self):
2070
test_list = ['bzrlib.tests.test_sampler.DemoTest.test_nothing']
2071
loader = self._create_loader(test_list)
2073
suite = loader.loadTestsFromModuleName('bzrlib.tests.test_sampler')
2074
self.assertEquals(test_list, _test_ids(suite))
2076
def test_exclude_tests(self):
2077
test_list = ['bogus']
2078
loader = self._create_loader(test_list)
2080
suite = loader.loadTestsFromModuleName('bzrlib.tests.test_sampler')
2081
self.assertEquals([], _test_ids(suite))