/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to tests/test_push.py

Cope with tuples in refs dictionary.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
"""Tests for pushing revisions from Bazaar into Git."""
19
19
 
 
20
from bzrlib import (
 
21
    errors,
 
22
    )
20
23
from bzrlib.bzrdir import (
21
24
    format_registry,
22
25
    )
47
50
        self.assertIsInstance(self.interrepo, InterToGitRepository)
48
51
 
49
52
    def test_pointless_fetch_refs(self):
50
 
        revidmap, old_refs, new_refs = self.interrepo.fetch_refs(lambda x: {}, lossy=False)
51
 
        self.assertEquals(old_refs, {'HEAD': ('ref: refs/heads/master', None)})
52
 
        self.assertEquals(new_refs, {})
 
53
        old_refs, new_refs = self.interrepo.fetch_refs(lambda x: x)
 
54
        self.assertEquals(old_refs, new_refs)
53
55
 
54
56
    def test_pointless_dfetch_refs(self):
55
 
        revidmap, old_refs, new_refs = self.interrepo.fetch_refs(lambda x: {}, lossy=True)
56
 
        self.assertEquals(old_refs, {'HEAD': ('ref: refs/heads/master', None)})
57
 
        self.assertEquals(new_refs, {})
 
57
        revidmap, old_refs, new_refs = self.interrepo.dfetch_refs(lambda x: x)
 
58
        self.assertEquals(old_refs, new_refs)
58
59
        self.assertEquals(revidmap, {})
59
60
 
60
61
    def test_pointless_missing_revisions(self):
61
 
        self.interrepo.source_store.lock_read()
62
 
        self.addCleanup(self.interrepo.source_store.unlock)
63
62
        self.assertEquals([], list(self.interrepo.missing_revisions([])))
64
63
 
65
64
    def test_missing_revisions_unknown_stop_rev(self):
66
 
        self.interrepo.source_store.lock_read()
67
 
        self.addCleanup(self.interrepo.source_store.unlock)
68
65
        self.assertEquals([],
69
66
                list(self.interrepo.missing_revisions([(None, "unknown")])))