mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-05 11:48:33 +08:00
This is the first step to have some tests, that we could run against an MBS instance, to check that it's functionally correct. Ultimately, these will replace the test scripts (`contrib/test-*`). This doesn't really do anything yet, but I would like to make sure that everyone is on the same page regarding how this will be set up. Signed-off-by: Hunor Csomortáni <csomh@redhat.com>
40 lines
685 B
Python
40 lines
685 B
Python
# -*- coding: utf-8 -*-
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
import os
|
|
|
|
import yaml
|
|
import pytest
|
|
|
|
from utils import MBS, Git, Koji
|
|
|
|
|
|
def load_test_env():
|
|
"""Load test environment configuration
|
|
|
|
:return: Test environment configuration.
|
|
:rtype: dict
|
|
"""
|
|
config_file = os.getenv("MBS_TEST_CONFIG", "test.env.yaml")
|
|
with open(config_file) as f:
|
|
env = yaml.safe_load(f)
|
|
return env
|
|
|
|
|
|
test_env = load_test_env()
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def mbs():
|
|
return MBS(test_env["mbs_api"])
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def git():
|
|
return Git(test_env["git_url"])
|
|
|
|
|
|
@pytest.fixture(scope="session")
|
|
def koji():
|
|
return Koji(**test_env["koji"])
|