Fedeproxy-git-ActivityPub-r.../tests/fedeproxy/common/test_gitlab.py

29 lines
909 B
Python

import os
import pytest
import gzip
from fedeproxy.common.gitlab import GitLab
@pytest.mark.gitlab
def test_project_create():
ip = os.environ.get('FEDEPROXY_IP', '0.0.0.0')
gitlab = GitLab(f'http://{ip}:8181')
gitlab.login('root', 'Wrobyak4')
gitlab.project_delete('root', 'testproject')
assert gitlab.project_get('root', 'testproject') is None
p = gitlab.project_create('root', 'testproject')
assert p['id'] == gitlab.project_create('root', 'testproject')['id']
@pytest.mark.gitlab
def test_project_export(tmpdir):
ip = os.environ.get('FEDEPROXY_IP', '0.0.0.0')
gitlab = GitLab(f'http://{ip}:8181')
gitlab.login('root', 'Wrobyak4')
gitlab.project_delete('root', 'testproject')
gitlab.project_create('root', 'testproject')
exported = f'{tmpdir}/testproject.zip'
gitlab.project_export('root', 'testproject', exported)
assert gzip.open(exported)