Rev 198: Add tests for DummyRevision. in file:///home/jelmer/bzr-gtk/trunk/
Jelmer Vernooij
jelmer at samba.org
Sat May 19 17:15:14 BST 2007
At file:///home/jelmer/bzr-gtk/trunk/
------------------------------------------------------------
revno: 198
revision-id: jelmer at samba.org-20070519161511-49bky3avi2uh9uvq
parent: jelmer at samba.org-20070519095819-d1khttifjfcoqa2f
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Sat 2007-05-19 17:15:11 +0100
message:
Add tests for DummyRevision.
added:
tests/test_viz.py test_viz.py-20070519100201-z988efzv90lew5g9-1
modified:
tests/__init__.py __init__.py-20070201155018-mi2dl3spgj7fqdum-1
viz/graph.py graph.py-20051016214152-ebf565808c860cf7
=== added file 'tests/test_viz.py'
--- a/tests/test_viz.py 1970-01-01 00:00:00 +0000
+++ b/tests/test_viz.py 2007-05-19 16:15:11 +0000
@@ -0,0 +1,27 @@
+# Copyright (C) 2007 Jelmer Vernooij <jelmer at samba.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+from bzrlib.plugins.gtk.viz.graph import DummyRevision
+from bzrlib.tests import TestCase
+
+class TestDummyRevision(TestCase):
+ def test_dummy_revision(self):
+ d = DummyRevision("blarev")
+ self.assertEquals("blarev", d.revision_id)
+ self.assertEquals({}, d.properties)
+ self.assertIs(None, d.committer)
+ self.assertIs(None, d.timestamp)
+ self.assertIs(None, d.timezone)
=== modified file 'tests/__init__.py'
--- a/tests/__init__.py 2007-03-23 12:46:47 +0000
+++ b/tests/__init__.py 2007-05-19 16:15:11 +0000
@@ -27,6 +27,7 @@
testmod_names = [
'test_preferences',
'test_history',
+ 'test_viz'
]
if os.name == 'nt':
=== modified file 'viz/graph.py'
--- a/viz/graph.py 2007-05-19 09:58:19 +0000
+++ b/viz/graph.py 2007-05-19 16:15:11 +0000
@@ -10,10 +10,11 @@
__author__ = "Scott James Remnant <scott at ubuntu.com>"
+from bzrlib.revision import Revision
from bzrlib.tsort import merge_sort
-class DummyRevision(object):
+class DummyRevision(Revision):
"""Dummy bzr revision.
Sometimes, especially in older bzr branches, a revision is referenced
@@ -21,15 +22,10 @@
When this happens we use an instance of this class instead of the real
Revision object (which we can't get).
"""
-
def __init__(self, revid):
- self.revision_id = revid
- self.parent_ids = []
+ super(DummyRevision, self).__init__(revid)
self.committer = None
- self.timestamp = None
- self.timezone = None
- self.message = self.revision_id
- self.properties = {}
+ self.message = revid
class RevisionProxy(object):
More information about the bazaar-commits
mailing list