~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_groupcompress.py

  • Committer: Vincent Ladeuil
  • Date: 2010-10-08 10:50:51 UTC
  • mfrom: (5050.17.31 2.2.2-dev)
  • mto: This revision was merged to the branch mainline in revision 5474.
  • Revision ID: v.ladeuil+lp@free.fr-20101008105051-xd4knkrohzclffic
Merge 2.2 into trunk including fixes for bug #651706 and bug #646133

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2008-2011 Canonical Ltd
 
1
# Copyright (C) 2008, 2009, 2010 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
30
30
    )
31
31
from bzrlib.osutils import sha_string
32
32
from bzrlib.tests.test__groupcompress import compiled_groupcompress_feature
33
 
from bzrlib.tests.scenarios import load_tests_apply_scenarios
34
 
 
35
 
 
36
 
def group_compress_implementation_scenarios():
 
33
 
 
34
 
 
35
def load_tests(standard_tests, module, loader):
 
36
    """Parameterize tests for all versions of groupcompress."""
 
37
    to_adapt, result = tests.split_suite_by_condition(
 
38
        standard_tests, tests.condition_isinstance(TestAllGroupCompressors))
37
39
    scenarios = [
38
40
        ('python', {'compressor': groupcompress.PythonGroupCompressor}),
39
41
        ]
40
42
    if compiled_groupcompress_feature.available():
41
43
        scenarios.append(('C',
42
44
            {'compressor': groupcompress.PyrexGroupCompressor}))
43
 
    return scenarios
44
 
 
45
 
 
46
 
load_tests = load_tests_apply_scenarios
 
45
    return tests.multiply_tests(to_adapt, scenarios, result)
47
46
 
48
47
 
49
48
class TestGroupCompressor(tests.TestCase):
67
66
class TestAllGroupCompressors(TestGroupCompressor):
68
67
    """Tests for GroupCompressor"""
69
68
 
70
 
    scenarios = group_compress_implementation_scenarios()
71
 
    compressor = None # Set by scenario
 
69
    compressor = None # Set by multiply_tests
72
70
 
73
71
    def test_empty_delta(self):
74
72
        compressor = self.compressor()