Changeset - 2cc8d876d1c8
[Not reviewed]
default
0 1 0
Thomas De Schampheleire - 10 years ago 2016-02-11 12:13:50
thomas.de.schampheleire@gmail.com
tests: summary: fix inter-test dependency

Test test_index_trending depended on previous actions performed by the test
test_index_statistics. Such inter-test dependencies should not be present.

This would become a problem when converting the test class to pytest-style,
because the app is recreated for each test, while the original
TestController creates it once per class.
1 file changed with 6 insertions and 0 deletions:
0 comments (0 inline, 0 general)
kallithea/tests/functional/test_summary.py
Show inline comments
 
@@ -118,12 +118,15 @@ class TestSummaryController(TestControll
 
    def test_index_trending(self):
 
        self.log_user()
 
        #codes stats
 
        self._enable_stats(HG_REPO)
 

	
 
        ScmModel().mark_for_invalidation(HG_REPO)
 
        # generate statistics first
 
        response = self.app.get(url(controller='summary', action='statistics',
 
                                    repo_name=HG_REPO))
 
        response = self.app.get(url(controller='summary', action='index',
 
                                    repo_name=HG_REPO))
 
        response.mustcontain(
 
            '[["py", {"count": 68, "desc": ["Python"]}], '
 
            '["rst", {"count": 16, "desc": ["Rst"]}], '
 
            '["css", {"count": 2, "desc": ["Css"]}], '
 
@@ -148,12 +151,15 @@ class TestSummaryController(TestControll
 
    def test_index_trending_git(self):
 
        self.log_user()
 
        #codes stats
 
        self._enable_stats(GIT_REPO)
 

	
 
        ScmModel().mark_for_invalidation(GIT_REPO)
 
        # generate statistics first
 
        response = self.app.get(url(controller='summary', action='statistics',
 
                                    repo_name=GIT_REPO))
 
        response = self.app.get(url(controller='summary', action='index',
 
                                    repo_name=GIT_REPO))
 
        response.mustcontain(
 
            '[["py", {"count": 68, "desc": ["Python"]}], '
 
            '["rst", {"count": 16, "desc": ["Rst"]}], '
 
            '["css", {"count": 2, "desc": ["Css"]}], '
0 comments (0 inline, 0 general)