Changeset - a918c4c5a841
[Not reviewed]
default
0 1 0
Søren Løvborg - 9 years ago 2017-01-17 17:47:33
sorenl@unity3d.com
tests: fix test_permanent_url_protocol_access instability

Since the test repositories are created in the database by scanning the
file system, their IDs depends on the (non-deterministic) order in which
files are listed by the file system.

The solution, of course, is to ask the database for the ID instead of
assuming it will be ID 1.
1 file changed with 7 insertions and 2 deletions:
0 comments (0 inline, 0 general)
kallithea/tests/functional/test_admin_repos.py
Show inline comments
 
@@ -609,9 +609,14 @@ class TestAdminReposControllerHG(_BaseTe
 
    REPO_TYPE = 'hg'
 
    NEW_REPO = NEW_HG_REPO
 
    OTHER_TYPE_REPO = GIT_REPO
 
    OTHER_TYPE = 'git'
 

	
 
    def test_permanent_url_protocol_access(self):
 
        repo = Repository.get_by_repo_name(self.REPO)
 
        permanent_name = '_%d' % repo.repo_id
 

	
 
        # 400 Bad Request - Unable to detect pull/push action
 
        self.app.get(url('summary_home', repo_name='_1'), extra_environ={'HTTP_ACCEPT': 'application/mercurial'},
 
                     status=400)
 
        self.app.get(url('summary_home', repo_name=permanent_name),
 
            extra_environ={'HTTP_ACCEPT': 'application/mercurial'},
 
            status=400,
 
        )
0 comments (0 inline, 0 general)