~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testremotebranch.py

  • Committer: Robert Collins
  • Date: 2005-09-29 02:01:49 UTC
  • Revision ID: robertc@robertcollins.net-20050929020149-1ff16722c6a01b2c
reenable remotebranch tests

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
import os
23
23
 
24
24
from bzrlib.selftest.HTTPTestUtil import TestCaseWithWebserver
25
 
        
 
25
 
 
26
from bzrlib.selftest.testfetch import fetch_steps
26
27
 
27
28
class TestFetch(TestCaseWithWebserver):
28
29
    def runTest(self):
49
50
        to_unzip_output.write(content)
50
51
        to_unzip_output.close()
51
52
        
52
 
        import pdb;pdb.set_trace()
53
53
        br_rem = Branch.open(self.get_remote_url(br_a.base))
54
 
        assert not has_revision(br_b, br_rem.revision_history()[3])
55
 
        assert has_revision(br_b, br_rem.revision_history()[2])
56
 
        assert len(br_b.revision_history()) == 7
57
 
        assert greedy_fetch(br_b, br_rem, br_rem.revision_history()[2])[0] == 0
58
 
 
59
 
        # greedy_fetch is not supposed to alter the revision history
60
 
        assert len(br_b.revision_history()) == 7
61
 
        assert not has_revision(br_b, br_rem.revision_history()[3])
62
 
 
63
 
        assert len(br_b.revision_history()) == 7
64
 
        assert greedy_fetch(br_b, br_rem, br_rem.revision_history()[3])[0] == 1
65
 
        assert has_revision(br_b, br_a.revision_history()[3])
66
 
        assert not has_revision(br_rem, br_b.revision_history()[3])
67
 
        assert not has_revision(br_rem, br_b.revision_history()[4])
68
 
 
69
 
        # When a non-branch ancestor is missing, it should be a failure, not
70
 
        # exception
71
 
        br_a4 = new_branch('br_a4')
72
 
        count, failures = greedy_fetch(br_a4, br_rem)
73
 
        assert count == 6
74
 
        assert failures == set((br_b.revision_history()[4],
75
 
                                br_b.revision_history()[5])) 
76
 
 
77
 
        assert greedy_fetch(br_a, br_b)[0] == 4
78
 
        assert has_revision(br_a, br_b.revision_history()[3])
79
 
        assert has_revision(br_a, br_b.revision_history()[4])
80
 
 
81
 
        br_b2 = new_branch('br_b2')
82
 
        assert greedy_fetch(br_b2, br_b)[0] == 7
83
 
        assert has_revision(br_b2, br_b.revision_history()[4])
84
 
        assert has_revision(br_b2, br_a.revision_history()[2])
85
 
        assert not has_revision(br_b2, br_a.revision_history()[3])
86
 
 
87
 
        br_a2 = new_branch('br_a2')
88
 
        assert greedy_fetch(br_a2, br_rem)[0] == 9
89
 
        assert has_revision(br_a2, br_b.revision_history()[4])
90
 
        assert has_revision(br_a2, br_a.revision_history()[3])
 
54
        fetch_steps(self, br_rem, br_b, br_a)
 
55