diff rhodecode/tests/functional/test_shortlog.py @ 3039:a520d542697e beta

Implemented file history page for showing detailed changelog for a given file - fixed git detection of filenode history when executed on directory - shortlog uses urlify_commit function now
author Marcin Kuzminski <marcin@python-works.com>
date Wed, 28 Nov 2012 01:27:21 +0100
parents 8acbfa837180
children 6302a1423a4e
line wrap: on
line diff
--- a/rhodecode/tests/functional/test_shortlog.py	Tue Nov 27 23:57:00 2012 +0100
+++ b/rhodecode/tests/functional/test_shortlog.py	Wed Nov 28 01:27:21 2012 +0100
@@ -1,8 +1,65 @@
 from rhodecode.tests import *
 
+
 class TestShortlogController(TestController):
 
-    def test_index(self):
+    def test_index_hg(self):
+        self.log_user()
+        response = self.app.get(url(controller='shortlog', action='index',
+                                    repo_name=HG_REPO))
+        # Test response...
+
+    def test_index_git(self):
+        self.log_user()
+        response = self.app.get(url(controller='shortlog', action='index',
+                                    repo_name=GIT_REPO))
+        # Test response...
+
+    def test_index_hg_with_filenode(self):
+        self.log_user()
+        response = self.app.get(url(controller='shortlog', action='index',
+                                    revision='tip', f_path='/vcs/exceptions.py',
+                                    repo_name=HG_REPO))
+        #history commits messages
+        response.mustcontain('Added exceptions module, this time for real')
+        response.mustcontain('Added not implemented hg backend test case')
+        response.mustcontain('Added BaseChangeset class')
+        # Test response...
+
+    def test_index_git_with_filenode(self):
         self.log_user()
-        response = self.app.get(url(controller='shortlog', action='index',repo_name=HG_REPO))
-        # Test response...
+        response = self.app.get(url(controller='shortlog', action='index',
+                                    revision='tip', f_path='/vcs/exceptions.py',
+                                    repo_name=GIT_REPO))
+        #history commits messages
+        response.mustcontain('Added exceptions module, this time for real')
+        response.mustcontain('Added not implemented hg backend test case')
+        response.mustcontain('Added BaseChangeset class')
+
+    def test_index_hg_with_filenode_that_is_dirnode(self):
+        self.log_user()
+        response = self.app.get(url(controller='shortlog', action='index',
+                                    revision='tip', f_path='/tests',
+                                    repo_name=HG_REPO))
+        self.assertEqual(response.status, '302 Found')
+
+    def test_index_git_with_filenode_that_is_dirnode(self):
+        self.log_user()
+        response = self.app.get(url(controller='shortlog', action='index',
+                                    revision='tip', f_path='/tests',
+                                    repo_name=GIT_REPO))
+        self.assertEqual(response.status, '302 Found')
+
+    def test_index_hg_with_filenode_not_existing(self):
+        self.log_user()
+        response = self.app.get(url(controller='shortlog', action='index',
+                                    revision='tip', f_path='/wrong_path',
+                                    repo_name=HG_REPO))
+        self.assertEqual(response.status, '302 Found')
+
+    def test_index_git_with_filenode_not_existing(self):
+        self.log_user()
+        response = self.app.get(url(controller='shortlog', action='index',
+                                    revision='tip', f_path='/wrong_path',
+                                    repo_name=GIT_REPO))
+        self.assertEqual(response.status, '302 Found')