Changeset - ebc239a474a3
[Not reviewed]
default
0 2 0
Mads Kiilerich - 7 years ago 2018-05-29 12:25:43
mads@kiilerich.com
tests: clarify that fixture.create_repo_group takes a name, not a path

Don't pass a path on to the model layer - it can't and won't handle it correctly.
2 files changed with 6 insertions and 2 deletions:
0 comments (0 inline, 0 general)
kallithea/tests/api/api_base.py
Show inline comments
 
@@ -1128,10 +1128,13 @@ class _BaseTestApi(object):
 
        fixture.destroy_repo_group(repo_group_name)
 

	
 
    def test_api_create_repo_in_repo_group_without_permission(self):
 
        repo_group_name = u'%s/api-repo-repo' % TEST_REPO_GROUP
 
        repo_group_basename = u'api-repo-repo'
 
        repo_group_name = u'%s/%s' % (TEST_REPO_GROUP, repo_group_basename)
 
        repo_name = u'%s/api-repo' % repo_group_name
 

	
 
        rg = fixture.create_repo_group(repo_group_name)
 
        top_group = RepoGroup.get_by_group_name(TEST_REPO_GROUP)
 
        assert top_group
 
        rg = fixture.create_repo_group(repo_group_basename, group_parent_id=top_group)
 
        Session().commit()
 
        RepoGroupModel().grant_user_permission(repo_group_name,
 
                                               self.TEST_USER_LOGIN,
kallithea/tests/fixture.py
Show inline comments
 
@@ -194,6 +194,7 @@ class Fixture(object):
 
        Session().commit()
 

	
 
    def create_repo_group(self, name, parent_group_id=None, **kwargs):
 
        assert '/' not in name, (name, kwargs) # use group_parent_id to make nested groups
 
        if 'skip_if_exists' in kwargs:
 
            del kwargs['skip_if_exists']
 
            gr = RepoGroup.get_by_group_name(group_name=name)
0 comments (0 inline, 0 general)