subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danie...@apache.org
Subject svn commit: r1292255 - /subversion/trunk/subversion/bindings/swig/python/tests/trac/versioncontrol/tests/svn_fs.py
Date Wed, 22 Feb 2012 12:35:42 GMT
Author: danielsh
Date: Wed Feb 22 12:35:42 2012
New Revision: 1292255

URL: http://svn.apache.org/viewvc?rev=1292255&view=rev
Log:
Attempt to fix a test to not rely on a specific APR hash order.

* subversion/bindings/swig/python/tests/trac/versioncontrol/tests/svn_fs.py
  (SubversionRepositoryTestCase.test_diff_dir_different_dirs):
    Allow any order for the actual values.

Modified:
    subversion/trunk/subversion/bindings/swig/python/tests/trac/versioncontrol/tests/svn_fs.py

Modified: subversion/trunk/subversion/bindings/swig/python/tests/trac/versioncontrol/tests/svn_fs.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/python/tests/trac/versioncontrol/tests/svn_fs.py?rev=1292255&r1=1292254&r2=1292255&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/python/tests/trac/versioncontrol/tests/svn_fs.py
(original)
+++ subversion/trunk/subversion/bindings/swig/python/tests/trac/versioncontrol/tests/svn_fs.py
Wed Feb 22 12:35:42 2012
@@ -278,16 +278,27 @@ class SubversionRepositoryTestCase(unitt
 
     def test_diff_dir_different_dirs(self):
         diffs = self.repos.get_deltas('trunk', 1, 'branches/v1x', 12)
-        self._cmp_diff((None, ('branches/v1x/dir1', 12),
-                        (Node.DIRECTORY, Changeset.ADD)), diffs.next())
-        self._cmp_diff((None, ('branches/v1x/dir1/dir2', 12),
-                        (Node.DIRECTORY, Changeset.ADD)), diffs.next())
-        self._cmp_diff((None, ('branches/v1x/dir1/dir3', 12),
-                        (Node.DIRECTORY, Changeset.ADD)), diffs.next())
-        self._cmp_diff((None, ('branches/v1x/README.txt', 12),
-                        (Node.FILE, Changeset.ADD)), diffs.next())
-        self._cmp_diff((None, ('branches/v1x/README2.txt', 12),
-                        (Node.FILE, Changeset.ADD)), diffs.next())
+        expected = [
+          (None, ('branches/v1x/README.txt', 12),
+           (Node.FILE, Changeset.ADD)),
+          (None, ('branches/v1x/README2.txt', 12),
+           (Node.FILE, Changeset.ADD)),
+          (None, ('branches/v1x/dir1', 12),
+           (Node.DIRECTORY, Changeset.ADD)),
+          (None, ('branches/v1x/dir1/dir2', 12),
+           (Node.DIRECTORY, Changeset.ADD)),
+          (None, ('branches/v1x/dir1/dir3', 12),
+           (Node.DIRECTORY, Changeset.ADD)),
+        ]
+        actual = [diffs.next() for i in range(5)]
+        actual = sorted(actual, key=lambda diff: (diff[1].path, diff[1].rev))
+        # for e,a in zip(expected, actual):
+        #   t.write("%r\n" % (e,))
+        #   t.write("%r\n" % ((None, (a[1].path, a[1].rev), (a[2], a[3])),) )
+        #   t.write('\n')
+        self.assertEqual(len(expected), len(actual))
+        for e,a in zip(expected, actual):
+          self._cmp_diff(e,a)
         self.assertRaises(StopIteration, diffs.next)
 
     def test_diff_dir_no_change(self):



Mime
View raw message