def repo(): repo = create_and_get_repo( 'testrepo测试-{}'.format(randstring(10)), '', USER, passwd=None ) try: yield repo finally: if seafile_api.get_repo(repo.id): # The repo may be deleted in the test case seafile_api.remove_repo(repo.id)
def repo(): repo = create_and_get_repo( 'test_repo_{}'.format(randstring(10)), '', USER, passwd=None ) try: seafile_api.post_dir(repo.id, '/', 'dir1', USER) seafile_api.post_dir(repo.id, '/', 'dir2', USER) yield repo finally: if seafile_api.get_repo(repo.id): # The repo may be deleted in the test case seafile_api.remove_repo(repo.id)
def encrypted_repo(): repo = create_and_get_repo( 'test_repo_{}'.format(randstring(10)), '', USER, passwd='123' ) try: syncwerk_api.post_dir(repo.id, '/', 'dir1', USER) syncwerk_api.post_dir(repo.id, '/', 'dir2', USER) syncwerk_api.post_dir(repo.id, '/dir1', 'subdir1', USER) syncwerk_api.post_dir(repo.id, '/dir2', 'subdir2', USER) yield repo finally: if syncwerk_api.get_repo(repo.id): # The repo may be deleted in the test case syncwerk_api.remove_repo(repo.id)