~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_push.py

  • Committer: Andrew Bennetts
  • Date: 2010-12-14 23:14:44 UTC
  • mfrom: (5569 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5570.
  • Revision ID: andrew.bennetts@canonical.com-20101214231444-uubf7zjbg8q92ocs
MergeĀ lp:bzr.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
from bzrlib.tests import (
35
35
    blackbox,
36
36
    http_server,
 
37
    scenarios,
37
38
    test_foreign,
38
39
    test_server,
39
40
    )
40
41
from bzrlib.transport import memory
41
42
 
42
43
 
43
 
def load_tests(standard_tests, module, loader):
44
 
    """Multiply tests for the push command."""
45
 
    result = loader.suiteClass()
46
 
 
47
 
    # one for each king of change
48
 
    changes_tests, remaining_tests = tests.split_suite_by_condition(
49
 
        standard_tests, tests.condition_isinstance((
50
 
                TestPushStrictWithChanges,
51
 
                )))
52
 
    changes_scenarios = [
53
 
        ('uncommitted',
54
 
         dict(_changes_type= '_uncommitted_changes')),
55
 
        ('pending-merges',
56
 
         dict(_changes_type= '_pending_merges')),
57
 
        ('out-of-sync-trees',
58
 
         dict(_changes_type= '_out_of_sync_trees')),
59
 
        ]
60
 
    tests.multiply_tests(changes_tests, changes_scenarios, result)
61
 
    # No parametrization for the remaining tests
62
 
    result.addTests(remaining_tests)
63
 
 
64
 
    return result
 
44
load_tests = scenarios.load_tests_apply_scenarios
65
45
 
66
46
 
67
47
class TestPush(tests.TestCaseWithTransport):
251
231
        # being too low. If rpc_count increases, more network roundtrips have
252
232
        # become necessary for this use case. Please do not adjust this number
253
233
        # upwards without agreement from bzr's network support maintainers.
254
 
        self.assertLength(14, self.hpss_calls)
 
234
        self.assertLength(13, self.hpss_calls)
255
235
        remote = branch.Branch.open('public')
256
236
        self.assertEndsWith(remote.get_stacked_on_url(), '/parent')
257
237
 
729
709
        self.assertPushSucceeds([])
730
710
 
731
711
 
 
712
strict_push_change_scenarios = [
 
713
    ('uncommitted',
 
714
        dict(_changes_type= '_uncommitted_changes')),
 
715
    ('pending-merges',
 
716
        dict(_changes_type= '_pending_merges')),
 
717
    ('out-of-sync-trees',
 
718
        dict(_changes_type= '_out_of_sync_trees')),
 
719
    ]
 
720
 
 
721
 
732
722
class TestPushStrictWithChanges(tests.TestCaseWithTransport,
733
723
                                TestPushStrictMixin):
734
724
 
 
725
    scenarios = strict_push_change_scenarios 
735
726
    _changes_type = None # Set by load_tests
736
727
 
737
728
    def setUp(self):