~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test__chk_map.py

  • Committer: Gordon Tyler
  • Date: 2010-01-14 15:24:04 UTC
  • mto: (5037.3.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5046.
  • Revision ID: gordon@doxxx.net-20100114152404-d64ik2afl96lcml0
Reverted changes to test_rules since the original should work now.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2009, 2010 Canonical Ltd
 
1
# Copyright (C) 2009 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
25
25
 
26
26
 
27
27
def load_tests(standard_tests, module, loader):
28
 
    suite, _ = tests.permute_tests_for_extension(standard_tests, loader,
29
 
        'bzrlib._chk_map_py', 'bzrlib._chk_map_pyx')
 
28
    # parameterize all tests in this module
 
29
    suite = loader.suiteClass()
 
30
    import bzrlib._chk_map_py as py_module
 
31
    scenarios = [('python', {'module': py_module})]
 
32
    if compiled_chkmap_feature.available():
 
33
        scenarios.append(('C', {'module': compiled_chkmap_feature.module}))
 
34
    else:
 
35
        # the compiled module isn't available, so we add a failing test
 
36
        class FailWithoutFeature(tests.TestCase):
 
37
            def test_fail(self):
 
38
                self.requireFeature(compiled_chkmap_feature)
 
39
        suite.addTest(loader.loadTestsFromTestCase(FailWithoutFeature))
 
40
    tests.multiply_tests(standard_tests, scenarios, suite)
30
41
    return suite
31
42
 
32
43
 
 
44
compiled_chkmap_feature = tests.ModuleAvailableFeature('bzrlib._chk_map_pyx')
 
45
 
 
46
 
33
47
class TestSearchKeys(tests.TestCase):
34
48
 
35
49
    module = None # Filled in by test parameterization