mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 18:09:57 -03:30
22 lines
564 B
Python
22 lines
564 B
Python
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
|