diff options
author | Max Wittig <max.wittig@siemens.com> | 2020-08-26 11:01:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-26 11:01:17 +0200 |
commit | a7e44a0bb3629f776a52967d56ba67d9a61346eb (patch) | |
tree | 24fb533a60a84e71386cc500d6ac2f00548f96ac /gitlab/tests/conftest.py | |
parent | e2dc9ece1a0af37073c41bfa8161fcec5fa01234 (diff) | |
parent | 204782a117f77f367dee87aa2c70822587829147 (diff) | |
download | gitlab-a7e44a0bb3629f776a52967d56ba67d9a61346eb.tar.gz |
Merge pull request #1078 from python-gitlab/refactor/split-unit-tests
Refactor: split unit tests by API resources
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) |