change known error codes

This commit is contained in:
2025-02-26 13:41:53 +01:00
parent ffbe63d1a5
commit bfbd80d537
3 changed files with 29 additions and 21 deletions

View File

@@ -2,7 +2,7 @@ import pytest
from delta_barth.api import common
from delta_barth.constants import HTTP_CONTENT_HEADERS
from delta_barth.errors import UnspecifiedRequestType
from delta_barth.errors import UnknownApiErrorCode, UnspecifiedRequestType
from delta_barth.types import HttpRequestTypes
"http://test.com/ "
@@ -57,6 +57,13 @@ def test_ping(api_base_url):
resp = common.ping(api_base_url, HttpRequestTypes.POST)
@pytest.mark.api_con_required
def test_raise_unknown_error(api_base_url):
resp = common.ping(api_base_url, HttpRequestTypes.GET)
with pytest.raises(UnknownApiErrorCode):
common._raise_for_unknown_error(resp)
@pytest.mark.api_con_required
def test_login_logout(credentials, api_base_url):
assert HTTP_CONTENT_HEADERS.session_token is None