changeset 3045:b81680c97494 beta

fixed tests
author Marcin Kuzminski <marcin@python-works.com>
date Thu, 29 Nov 2012 21:35:08 +0100
parents c57a37430dc9
children be781af446af
files rhodecode/lib/vcs/backends/git/inmemory.py rhodecode/tests/vcs/test_git.py rhodecode/tests/vcs/test_hg.py
diffstat 3 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/lib/vcs/backends/git/inmemory.py	Thu Nov 29 19:59:47 2012 +0100
+++ b/rhodecode/lib/vcs/backends/git/inmemory.py	Thu Nov 29 21:35:08 2012 +0100
@@ -154,7 +154,6 @@
 
         # Update vcs repository object & recreate dulwich repo
         self.repository.revisions.append(commit.id)
-        self.repository._repo = Repo(self.repository.path)
         # invalidate parsed refs after commit
         self.repository._parsed_refs = self.repository._get_parsed_refs()
         tip = self.repository.get_changeset()
--- a/rhodecode/tests/vcs/test_git.py	Thu Nov 29 19:59:47 2012 +0100
+++ b/rhodecode/tests/vcs/test_git.py	Thu Nov 29 21:35:08 2012 +0100
@@ -470,9 +470,11 @@
         for fname, revision_dict in files.items():
             for rev, data in revision_dict.items():
                 cs = self.repo.get_changeset(rev)
-                ann = cs.get_file_annotate(fname)
 
-                l1 = [x[1].raw_id for x in ann]
+                l1_1 = [x[1] for x in cs.get_file_annotate(fname)]
+                l1_2 = [x[2]().raw_id for x in cs.get_file_annotate(fname)]
+                self.assertEqual(l1_1, l1_2)
+                l1 = l1_1
                 l2 = files[fname][rev]['changesets']
                 self.assertTrue(l1 == l2 , "The lists of revision for %s@rev %s"
                                 "from annotation list should match each other, "
--- a/rhodecode/tests/vcs/test_hg.py	Thu Nov 29 19:59:47 2012 +0100
+++ b/rhodecode/tests/vcs/test_hg.py	Thu Nov 29 21:35:08 2012 +0100
@@ -392,13 +392,13 @@
                                  55: {'lines_no': 3,
                                      'changesets': [7, 7, 7]}}}
 
-
         for fname, revision_dict in files.items():
             for rev, data in revision_dict.items():
                 cs = self.repo.get_changeset(rev)
-                ann = cs.get_file_annotate(fname)
-
-                l1 = [x[1].revision for x in ann]
+                l1_1 = [x[1] for x in cs.get_file_annotate(fname)]
+                l1_2 = [x[2]().raw_id for x in cs.get_file_annotate(fname)]
+                self.assertEqual(l1_1, l1_2)
+                l1 = l1_2 = [x[2]().revision for x in cs.get_file_annotate(fname)]
                 l2 = files[fname][rev]['changesets']
                 self.assertTrue(l1 == l2 , "The lists of revision for %s@rev%s"
                                 "from annotation list should match each other,"