diff options
author | Nejc Habjan <nejc.habjan@siemens.com> | 2020-08-29 17:48:27 +0200 |
---|---|---|
committer | Nejc Habjan <nejc.habjan@siemens.com> | 2020-08-31 23:48:55 +0200 |
commit | 66d108de9665055921123476426fb6716c602496 (patch) | |
tree | 77afaad489e7b162345ed50bf1dc1bf1dd8c3b61 /tools/functional/conftest.py | |
parent | 4492fc42c9f6e0031dd3f3c6c99e4c58d4f472ff (diff) | |
download | gitlab-66d108de9665055921123476426fb6716c602496.tar.gz |
test(api): add tests for variables API
Diffstat (limited to 'tools/functional/conftest.py')
-rw-r--r-- | tools/functional/conftest.py | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/tools/functional/conftest.py b/tools/functional/conftest.py index bd99fa9..e12471b 100644 --- a/tools/functional/conftest.py +++ b/tools/functional/conftest.py @@ -1,3 +1,5 @@ +import os +import tempfile from random import randint import pytest @@ -5,6 +7,9 @@ import pytest import gitlab +TEMP_DIR = tempfile.gettempdir() + + def random_id(): """ Helper to ensure new resource creation does not clash with @@ -17,27 +22,7 @@ def random_id(): @pytest.fixture(scope="session") def CONFIG(): - return "/tmp/python-gitlab.cfg" - - -@pytest.fixture -def gitlab_cli(script_runner, CONFIG): - """Wrapper fixture to help make test cases less verbose.""" - - def _gitlab_cli(subcommands): - """ - Return a script_runner.run method that takes a default gitlab - command, and subcommands passed as arguments inside test cases. - """ - command = ["gitlab", "--config-file", CONFIG] - - for subcommand in subcommands: - # ensure we get strings (e.g from IDs) - command.append(str(subcommand)) - - return script_runner.run(*command) - - return _gitlab_cli + return os.path.join(TEMP_DIR, "python-gitlab.cfg") @pytest.fixture(scope="session") |