~maria-captains/bzr-gtk/serg

« back to all changes in this revision

Viewing changes to tests/test_commit.py

  • Committer: Sergei Golubchik
  • Date: 2014-05-05 15:48:54 UTC
  • Revision ID: sergii@pisem.net-20140505154854-ba4w4r97otnroxkn
cherry-pick http://bazaar.launchpad.net/~bzr-gtk/bzr-gtk/gtk3/revision/777

Avoid the use of Repository.get_ancestry().

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
        tree.commit('one')
48
48
 
49
49
        self.addCleanup(tree.lock_read().unlock)
50
 
        self.assertIs(None, commit.pending_revisions(tree))
 
50
        self.assertEquals([], list(commit.pending_revisions(tree)))
51
51
 
52
52
    def test_pending_revisions_simple(self):
53
53
        tree = self.make_branch_and_tree('tree')
58
58
        self.assertEqual([rev_id1, rev_id2], tree.get_parent_ids())
59
59
 
60
60
        self.addCleanup(tree.lock_read().unlock)
61
 
        pending_revisions = commit.pending_revisions(tree)
 
61
        pending_revisions = list(commit.pending_revisions(tree))
62
62
        # One primary merge
63
63
        self.assertEqual(1, len(pending_revisions))
64
64
        # Revision == rev_id2
77
77
        self.assertEqual([rev_id1, rev_id4], tree.get_parent_ids())
78
78
 
79
79
        self.addCleanup(tree.lock_read().unlock)
80
 
        pending_revisions = commit.pending_revisions(tree)
 
80
        pending_revisions = list(commit.pending_revisions(tree))
81
81
        # One primary merge
82
82
        self.assertEqual(1, len(pending_revisions))
83
83
        # Revision == rev_id2
101
101
        self.assertEqual([rev_id1, rev_id3, rev_id5], tree.get_parent_ids())
102
102
 
103
103
        self.addCleanup(tree.lock_read().unlock)
104
 
        pending_revisions = commit.pending_revisions(tree)
 
104
        pending_revisions = list(commit.pending_revisions(tree))
105
105
        # Two primary merges
106
106
        self.assertEqual(2, len(pending_revisions))
107
107
        # Revision == rev_id2
150
150
 
151
151
        dlg = CommitDialogNoWidgets(tree)
152
152
        self.assertEqual(rev_id, dlg._basis_tree.get_revision_id())
153
 
        self.assertIs(None, dlg._pending)
 
153
        self.assertEquals([], dlg._pending)
154
154
        self.assertFalse(dlg._is_checkout)
155
155
 
156
156
    def test_setup_parameters_checkout(self):
161
161
 
162
162
        dlg = CommitDialogNoWidgets(tree2)
163
163
        self.assertEqual(rev_id, dlg._basis_tree.get_revision_id())
164
 
        self.assertIs(None, dlg._pending)
 
164
        self.assertEquals([], dlg._pending)
165
165
        self.assertTrue(dlg._is_checkout)
166
166
 
167
167
    def test_setup_parameters_pending(self):