1
0
mirror of https://github.com/haiwen/seafile-server.git synced 2025-09-16 07:10:07 +00:00

Add functional tests (#120)

* functional tests setup

* add a test case
This commit is contained in:
Shuai Lin
2018-01-16 17:10:26 +08:00
committed by GitHub
parent fa1e439633
commit b2d058badc
21 changed files with 542 additions and 689 deletions

19
tests/test_sharing.py Normal file
View File

@@ -0,0 +1,19 @@
import pytest
from seaserv import seafile_api as api
from seaserv import ccnet_api
from tests.config import ADMIN_USER, USER, USER2
@pytest.mark.parametrize('permission', ['r', 'rw'])
def test_share_repo(repo, permission):
assert api.check_permission(repo.id, USER2) is None
api.share_repo(repo.id, USER, USER2, permission)
assert api.check_permission(repo.id, USER2) == permission
repos = api.get_share_in_repo_list(USER2, 0, 1)
assert len(repos) == 1
r = repos[0]
assert r.id == repo.id
assert r.permission == permission