/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to tests/test_revisionview.py

  • Committer: Curtis Hovey
  • Date: 2011-08-12 20:25:28 UTC
  • mto: This revision was merged to the branch mainline in revision 741.
  • Revision ID: sinzui.is@verizon.net-20110812202528-4xf4a2t23urx50d2
Updated gst to gtk3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Test the RevisionView functionality."""
18
18
 
19
 
import os
20
 
 
21
19
from bzrlib import (
22
20
    tests,
23
21
    )
24
 
from bzrlib import bencode
 
22
try:
 
23
    from bzrlib import bencode
 
24
except ImportError:
 
25
    from bzrlib.util import bencode
25
26
 
26
27
from bzrlib.plugins.gtk import revisionview
27
28
 
28
29
 
29
 
def fake_icon_path(*args):
30
 
    return os.path.join(
31
 
        os.path.dirname(__file__),  '..', 'icons', *args)
32
 
 
33
 
 
34
30
class TestPendingRevisions(tests.TestCaseWithMemoryTransport):
35
31
 
36
 
    def setUp(self):
37
 
        super(TestPendingRevisions, self).setUp()
38
 
        self.overrideAttr(revisionview, 'icon_path', new=fake_icon_path)
39
 
 
40
32
    def assertBufferText(self, text, buffer):
41
33
        """Check the text stored in the buffer."""
42
34
        self.assertEqual(text, buffer.get_text(buffer.get_start_iter(),
50
42
        b = builder.get_branch()
51
43
 
52
44
        rv = revisionview.RevisionView(b)
53
 
        self.addCleanup(rv.destroy)
54
45
        rev = b.repository.get_revision('A')
55
46
        rv.set_revision(rev)
56
47
        self.assertEqual(rev.committer, rv.committer.get_text())
71
62
        b = tree.branch
72
63
 
73
64
        rv = revisionview.RevisionView(b)
74
 
        self.addCleanup(rv.destroy)
75
65
        rev = b.repository.get_revision('A')
76
66
        rv.set_revision(rev)
77
67
 
92
82
        b = tree.branch
93
83
 
94
84
        rv = revisionview.RevisionView(b)
95
 
        self.addCleanup(rv.destroy)
96
85
        rev = b.repository.get_revision('A')
97
86
        rv.set_revision(rev)
98
87