177
177
# create a revision, sign it, apply to the store.
180
class TestOperators(TestCase):
182
def test___eq__(self):
183
from bzrlib.revision import Revision, RevisionReference
184
revision1 = Revision("invid", "sha", "revid", 100, "boo", "john", [])
185
revision2 = Revision("invid", "sha", "revid", 100, "boo", "john", [])
186
revision3 = Revision("invid", "sha", "rev2id", 100, "bp", "john",
187
[RevisionReference("revid")])
188
self.assertEqual(revision1, revision1)
189
self.assertEqual(revision1, revision2)
190
self.assertNotEqual(revision1, revision3)
191
self.assertEqual(revision2, revision1)
192
self.assertEqual(revision2, revision2)
193
self.assertNotEqual(revision2, revision3)
194
self.assertNotEqual(revision3, revision1)
195
self.assertNotEqual(revision3, revision2)
196
self.assertEqual(revision3, revision3)
198
def test__eq__reference(self):
199
from bzrlib.revision import Revision, RevisionReference
200
ref1 = RevisionReference('revid', '1'*40)
201
ref2 = RevisionReference('revid', '1'*40)
202
ref3 = RevisionReference('revid', '2'*40)
203
ref4 = RevisionReference('revid2', '3'*40)
204
self.assertEqual(ref1, ref1)
205
self.assertEqual(ref1, ref2)
206
self.assertNotEqual(ref1, ref3)
207
self.assertNotEqual(ref1, ref4)
208
self.assertEqual(ref2, ref1)
209
self.assertEqual(ref2, ref2)
210
self.assertNotEqual(ref2, ref3)
211
self.assertNotEqual(ref2, ref4)
212
self.assertNotEqual(ref3, ref1)
213
self.assertNotEqual(ref3, ref2)
214
self.assertEqual(ref3, ref3)
215
self.assertNotEqual(ref3, ref4)
216
self.assertNotEqual(ref4, ref1)
217
self.assertNotEqual(ref4, ref2)
218
self.assertNotEqual(ref4, ref3)
219
self.assertEqual(ref4, ref4)