summaryrefslogtreecommitdiffstats
path: root/awxkit/test/api/pages/test_base.py
blob: 3126e333d8b9e38c98353180621823aed174d492 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from http.client import NOT_FOUND
import pytest

from awxkit.config import config


@pytest.fixture(autouse=True)
def setup_config(monkeypatch: pytest.MonkeyPatch) -> None:
    monkeypatch.setattr(config, "credentials", {"default": {"username": "foo", "password": "bar"}}, raising=False)
    monkeypatch.setattr(config, "base_url", "", raising=False)


@pytest.fixture
def response(mocker):
    r = mocker.Mock()
    r.status_code = NOT_FOUND
    r.json.return_value = {
        "token": "my_personal_token",
        "access_token": "my_token",
    }
    return r