~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_remote.py

  • Committer: Andrew Bennetts
  • Date: 2011-02-25 08:45:27 UTC
  • mto: This revision was merged to the branch mainline in revision 5695.
  • Revision ID: andrew.bennetts@canonical.com-20110225084527-0ucp7p00d00hoqon
Add another test.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1175
1175
            'error', ('NotStacked',))
1176
1176
        client.add_expected_call(
1177
1177
            'Branch.heads_to_fetch', ('quack/',),
1178
 
            'success', (['tip'], ['tag-1', 'tag-2']))
 
1178
            'success', (['tip'], ['tagged-1', 'tagged-2']))
1179
1179
        transport.mkdir('quack')
1180
1180
        transport = transport.clone('quack')
1181
1181
        branch = self.make_remote_branch(transport, client)
1182
1182
        branch._format._native_heads_to_fetch = lambda: False
1183
1183
        result = branch.heads_to_fetch()
1184
1184
        self.assertFinished(client)
1185
 
        self.assertEqual((set(['tip']), set(['tag-1', 'tag-2'])), result)
 
1185
        self.assertEqual((set(['tip']), set(['tagged-1', 'tagged-2'])), result)
 
1186
 
 
1187
    def test_backwards_compatible(self):
 
1188
        self.setup_smart_server_with_call_log()
 
1189
        # Make a branch with a single revision.
 
1190
        builder = self.make_branch_builder('foo')
 
1191
        builder.start_series()
 
1192
        builder.build_snapshot('tip', None, [
 
1193
            ('add', ('', 'root-id', 'directory', ''))])
 
1194
        builder.finish_series()
 
1195
        branch = builder.get_branch()
 
1196
        # Add two tags to that branch
 
1197
        branch.tags.set_tag('tag-1', 'rev-1')
 
1198
        branch.tags.set_tag('tag-2', 'rev-2')
 
1199
        self.addCleanup(branch.lock_read().unlock)
 
1200
        # Disable the heads_to_fetch verb
 
1201
        verb = 'Branch.heads_to_fetch'
 
1202
        self.disable_verb(verb)
 
1203
        self.reset_smart_call_log()
 
1204
        result = branch.heads_to_fetch()
 
1205
        self.assertEqual((set(['tip']), set(['rev-1', 'rev-2'])), result)
 
1206
        self.assertEqual(
 
1207
            ['Branch.last_revision_info', 'Branch.get_tags_bytes'],
 
1208
            [call.call.method for call in self.hpss_calls])
1186
1209
 
1187
1210
 
1188
1211
class TestBranchLastRevisionInfo(RemoteBranchTestCase):