api: refactor auth helpers to reflect the action they do.
- those validators verify and throws expcetions, which is now reflected in the name
This commit is contained in:
parent
1943efb1b8
commit
2a8b58692d
3 changed files with 7 additions and 7 deletions
|
|
@ -249,7 +249,7 @@ class TestRepoAccess(object):
|
|||
fake_repo = Mock()
|
||||
with self.repo_perm_patch as rmock:
|
||||
rmock.return_value = repo_mock
|
||||
assert utils.has_repo_permissions(
|
||||
assert utils.validate_repo_permissions(
|
||||
'fake_user', 'fake_repo_id', fake_repo,
|
||||
['perm1', 'perm2'])
|
||||
rmock.assert_called_once_with(*['perm1', 'perm2'])
|
||||
|
|
@ -263,6 +263,6 @@ class TestRepoAccess(object):
|
|||
with self.repo_perm_patch as rmock:
|
||||
rmock.return_value = repo_mock
|
||||
with pytest.raises(JSONRPCError) as excinfo:
|
||||
utils.has_repo_permissions(
|
||||
utils.validate_repo_permissions(
|
||||
'fake_user', 'fake_repo_id', fake_repo, 'perms')
|
||||
assert 'fake_repo_id' in excinfo
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue