Changeset - b7adbd5456c2
[Not reviewed]
beta
0 2 0
Marcin Kuzminski - 14 years ago 2012-01-13 05:38:36
marcin@python-works.com
test fixes for latest changes
2 files changed with 53 insertions and 40 deletions:
0 comments (0 inline, 0 general)
rhodecode/tests/functional/test_changelog.py
Show inline comments
 
from rhodecode.tests import *
 

	
 

	
 
class TestChangelogController(TestController):
 

	
 
    def test_index_hg(self):
 
@@ -7,21 +8,24 @@ class TestChangelogController(TestContro
 
        response = self.app.get(url(controller='changelog', action='index',
 
                                    repo_name=HG_REPO))
 

	
 
        self.assertTrue("""<div id="chg_20" class="container">"""
 
                        in response.body)
 
        self.assertTrue("""<input class="changeset_range" id="5e204e7583b9" """
 
                        """name="5e204e7583b9" type="checkbox" value="1" />"""
 
                        in response.body)
 
        self.assertTrue("""<span>commit 154: 5e204e7583b9@2010-08-09 """
 
                        """23:18:46</span>""" in response.body)
 
        response.mustcontain("""<div id="chg_20" class="container tablerow1">""")
 
        response.mustcontain(
 
            """<input class="changeset_range" id="5e204e7583b9" """
 
            """name="5e204e7583b9" type="checkbox" value="1" />"""
 
        )
 
        response.mustcontain(
 
            """<span class="changeset_id">154:"""
 
            """<span class="changeset_hash">5e204e7583b9</span></span>"""
 
        )
 

	
 
        self.assertTrue("""Small update at simplevcs app""" in response.body)
 

	
 
        response.mustcontain("""Small update at simplevcs app""")
 

	
 
        self.assertTrue("""<span id="5e204e7583b9c8e7b93a020bd036564b1e"""
 
                        """731dae" class="changed_total tooltip" """
 
                        """title="Affected number of files, click to """
 
                        """show more details">3</span>""" in response.body)
 
        response.mustcontain(
 
            """<div id="5e204e7583b9c8e7b93a020bd036564b1e731dae"  """
 
            """style="float:right;" class="changed_total tooltip" """
 
            """title="Affected number of files, click to show """
 
            """more details">3</div>"""
 
        )
 

	
 
        #pagination
 
        response = self.app.get(url(controller='changelog', action='index',
 
@@ -37,19 +41,24 @@ class TestChangelogController(TestContro
 
        response = self.app.get(url(controller='changelog', action='index',
 
                                    repo_name=HG_REPO), {'page':6})
 

	
 
        # Test response after pagination...
 
        response.mustcontain(
 
            """<input class="changeset_range" id="46ad32a4f974" """
 
            """name="46ad32a4f974" type="checkbox" value="1" />"""
 
        )
 
        response.mustcontain(
 
            """<span class="changeset_id">64:"""
 
            """<span class="changeset_hash">46ad32a4f974</span></span>"""
 
        )
 

	
 
        # Test response after pagination...
 
        self.assertTrue("""<input class="changeset_range" id="46ad32a4f974" """
 
                        """name="46ad32a4f974" type="checkbox" value="1" />"""
 
                        in response.body)
 
        self.assertTrue("""<span>commit 64: 46ad32a4f974@2010-04-19"""
 
                        """ 22:33:21</span>"""in response.body)
 
        response.mustcontain(
 
            """<div id="46ad32a4f974e45472a898c6b0acb600320579b1"  """
 
            """style="float:right;" class="changed_total tooltip" """
 
            """title="Affected number of files, click to show """
 
            """more details">21</div>"""
 
        )
 

	
 
        self.assertTrue("""<span id="46ad32a4f974e45472a898c6b0acb600320"""
 
                        """579b1" class="changed_total tooltip" """
 
                        """title="Affected number of files, click to """
 
                        """show more details">21</span>"""in response.body)
 
        self.assertTrue("""<div class="message"><a href="/%s/changeset/"""
 
        response.mustcontain("""<div class="message"><a href="/%s/changeset/"""
 
                        """46ad32a4f974e45472a898c6b0acb600320579b1">"""
 
                        """Merge with 2e6a2bf9356ca56df08807f4ad86d48"""
 
                        """0da72a8f4</a></div>""" % HG_REPO in response.body)
 
                        """0da72a8f4</a></div>""" % HG_REPO)
rhodecode/tests/functional/test_summary.py
Show inline comments
 
@@ -13,12 +13,16 @@ class TestSummaryController(TestControll
 
                                    repo_name=HG_REPO))
 

	
 
        #repo type
 
        response.mustcontain("""<img style="margin-bottom:2px" class="icon" """
 
                        """title="Mercurial repository" alt="Mercurial """
 
                        """repository" src="/images/icons/hgicon.png"/>""")
 
        response.mustcontain("""<img style="margin-bottom:2px" class="icon" """
 
                        """title="public repository" alt="public """
 
                        """repository" src="/images/icons/lock_open.png"/>""")
 
        response.mustcontain(
 
            """<img style="margin-bottom:2px" class="icon" """
 
            """title="Mercurial repository" alt="Mercurial """
 
            """repository" src="/images/icons/hgicon.png"/>"""
 
        )
 
        response.mustcontain(
 
            """<img style="margin-bottom:2px" class="icon" """
 
            """title="public repository" alt="public """
 
            """repository" src="/images/icons/lock_open.png"/>"""
 
        )
 

	
 
        #codes stats
 
        self._enable_stats()
 
@@ -26,15 +30,15 @@ class TestSummaryController(TestControll
 
        invalidate_cache('get_repo_cached_%s' % HG_REPO)
 
        response = self.app.get(url(controller='summary', action='index',
 
                                    repo_name=HG_REPO))
 

	
 
        self.assertTrue("""var data = {"py": {"count": 42, "desc": """
 
                        """["Python"]}, "rst": {"count": 11, "desc": """
 
                        """["Rst"]}, "sh": {"count": 2, "desc": ["Bash"]}, """
 
                        """"makefile": {"count": 1, "desc": ["Makefile", """
 
                        """"Makefile"]}, "cfg": {"count": 1, "desc": ["Ini"]},"""
 
                        """ "css": {"count": 1, "desc": ["Css"]}, "bat": """
 
                        """{"count": 1, "desc": ["Batch"]}};"""
 
                        in response.body)
 
        response.mustcontain(
 
            """var data = [["py", {"count": 42, "desc": ["Python"]}], """
 
            """["rst", {"count": 11, "desc": ["Rst"]}], """
 
            """["sh", {"count": 2, "desc": ["Bash"]}], """
 
            """["makefile", {"count": 1, "desc": ["Makefile", "Makefile"]}],"""
 
            """ ["cfg", {"count": 1, "desc": ["Ini"]}], """
 
            """["css", {"count": 1, "desc": ["Css"]}], """
 
            """["bat", {"count": 1, "desc": ["Batch"]}]];"""
 
        )
 

	
 
        # clone url...
 
        response.mustcontain("""<input style="width:80%;margin-left:105px" type="text" id="clone_url" readonly="readonly" value="http://test_admin@localhost:80/vcs_test_hg"/>""")
0 comments (0 inline, 0 general)