~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test__chunks_to_lines.py

  • Committer: Matt Nordhoff
  • Date: 2009-04-04 02:50:01 UTC
  • mfrom: (4253 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4256.
  • Revision ID: mnordhoff@mattnordhoff.com-20090404025001-z1403k0tatmc8l91
Merge bzr.dev, fixing conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
#
17
17
 
18
18
"""Tests for chunks_to_lines."""
22
22
 
23
23
def load_tests(standard_tests, module, loader):
24
24
    # parameterize all tests in this module
25
 
    suite = loader.suiteClass()
26
 
    applier = tests.TestScenarioApplier()
27
25
    import bzrlib._chunks_to_lines_py as py_module
28
 
    applier.scenarios = [('python', {'module': py_module})]
 
26
    scenarios = [('python', {'module': py_module})]
29
27
    if CompiledChunksToLinesFeature.available():
30
28
        import bzrlib._chunks_to_lines_pyx as c_module
31
 
        applier.scenarios.append(('C', {'module': c_module}))
 
29
        scenarios.append(('C', {'module': c_module}))
32
30
    else:
33
31
        # the compiled module isn't available, so we add a failing test
34
32
        class FailWithoutFeature(tests.TestCase):
35
33
            def test_fail(self):
36
34
                self.requireFeature(CompiledChunksToLinesFeature)
37
 
        suite.addTest(loader.loadTestsFromTestCase(FailWithoutFeature))
38
 
    tests.adapt_tests(standard_tests, applier, suite)
39
 
    return suite
 
35
        standard_tests.addTest(FailWithoutFeature("test_fail"))
 
36
    return tests.multiply_tests(standard_tests, scenarios, loader.suiteClass())
40
37
 
41
38
 
42
39
class _CompiledChunksToLinesFeature(tests.Feature):