diff options
| author | Oleksii Shkurupii <Oleksii.Shkurupii@playtech.com> | 2020-08-27 18:07:54 +0300 |
|---|---|---|
| committer | Oleksii Shkurupii <Oleksii.Shkurupii@playtech.com> | 2020-08-27 18:07:54 +0300 |
| commit | fa899d7a6e76acbe392f3debb5fd61d71bd88ed2 (patch) | |
| tree | af915190af31ded29c6545c67ac7c9cda294e195 /gitlab/tests/conftest.py | |
| parent | 88f8cc78f97156d5888a9600bdb8721720563120 (diff) | |
| parent | a038e9567fd16259e3ed360ab0defd779e9c3901 (diff) | |
| download | gitlab-fa899d7a6e76acbe392f3debb5fd61d71bd88ed2.tar.gz | |
Merge branch 'master' into issue-1154
Diffstat (limited to 'gitlab/tests/conftest.py')
| -rw-r--r-- | gitlab/tests/conftest.py | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/gitlab/tests/conftest.py b/gitlab/tests/conftest.py index 91752c6..98d97ae 100644 --- a/gitlab/tests/conftest.py +++ b/gitlab/tests/conftest.py @@ -10,3 +10,43 @@ def gl(): ssl_verify=True, api_version=4, ) + + +# Todo: parametrize, but check what tests it's really useful for +@pytest.fixture +def gl_trailing(): + return gitlab.Gitlab( + "http://localhost/", private_token="private_token", api_version=4 + ) + + +@pytest.fixture +def default_config(tmpdir): + valid_config = """[global] + default = one + ssl_verify = true + timeout = 2 + + [one] + url = http://one.url + private_token = ABCDEF + """ + + config_path = tmpdir.join("python-gitlab.cfg") + config_path.write(valid_config) + return str(config_path) + + +@pytest.fixture +def group(gl): + return gl.groups.get(1, lazy=True) + + +@pytest.fixture +def project(gl): + return gl.projects.get(1, lazy=True) + + +@pytest.fixture +def user(gl): + return gl.users.get(1, lazy=True) |
