1. Konstantine Rybnikov
  2. fat_po_editor

Commits

Konstantine Rybnikov  committed d035849

add tests for __eq__

  • Participants
  • Parent commits 329323b
  • Branches default

Comments (0)

Files changed (1)

File tests/test_diffutil.py

View file
             unicode(diff),
             (u"Added phrases:\n"
              u"    * First \\nmsgid\n"))
+
+    def test_eq_simple(self):
+        diff1 = Diff()
+        entry = POEntry(msgid=u"First msgid",
+                        msgstr=u"First msgstr")
+        diff1.entry_append('add', entry)
+        diff2 = Diff()
+        entry = POEntry(msgid=u"First msgid",
+                        msgstr=u"First msgstr")
+        diff2.entry_append('add', entry)
+        
+        self.assertEquals(diff1 == diff2, True)
+        
+    def test_eq_simple_noneq(self):
+        diff1 = Diff()
+        entry = POEntry(msgid=u"First msgid",
+                        msgstr=u"First msgstr")
+        diff1.entry_append('add', entry)
+        diff2 = Diff()
+        entry = POEntry(msgid=u"Second msgid",
+                        msgstr=u"Second msgstr")
+        diff2.entry_append('add', entry)
+        
+        self.assertEquals(diff1 == diff2, False)
+
+    def test_eq_empty(self):
+        diff1 = Diff()
+        diff2 = Diff()
+        
+        self.assertEquals(diff1 == diff2, True)