Skip to content

Commit

Permalink
tweak credential URL tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zxdavb committed Dec 24, 2024
1 parent fcb53aa commit 14b9ed8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion tests/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@

#
# normally, we want debug flags to be False
_DBG_USE_REAL_AIOHTTP = False
_DBG_TEST_CRED_URLS = False # avoid 429s: dont invalidate the credential cache
_DBG_USE_REAL_AIOHTTP = False # use 'real' aiohttp to reach vendor's servers
_DBG_DISABLE_STRICT_ASSERTS = False # of response content-type, schema

#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
TCC_POST_USR_SESSION,
)
from tests.const import (
_DBG_TEST_CRED_URLS,
_DBG_USE_REAL_AIOHTTP,
URL_BASE_V0 as URL_BASE,
URL_CRED_V0 as URL_CRED,
Expand Down Expand Up @@ -75,7 +76,7 @@ async def handle_too_many_requests(rsp: aiohttp.ClientResponse) -> None:


@pytest.mark.skipif(not _DBG_USE_REAL_AIOHTTP, reason="requires vendor's webserver")
async def _test_url_auth_bad0( # invalid server certificate
async def test_url_auth_bad0( # invalid server certificate
client_session: aiohttp.ClientSession,
) -> None:
"""Test authentication flow with invalid server certificate."""
Expand Down Expand Up @@ -164,6 +165,7 @@ async def test_url_auth_bad2( # invalid/expired session id


@pytest.mark.skipif(not _DBG_USE_REAL_AIOHTTP, reason="requires vendor's webserver")
@pytest.mark.skipif(not _DBG_TEST_CRED_URLS, reason="invalidates the credentials cache")
async def test_url_auth_good(
client_session: aiohttp.ClientSession,
credentials: tuple[str, str],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
TCC_STATUS_RESPONSE,
)
from tests.const import (
_DBG_TEST_CRED_URLS,
_DBG_USE_REAL_AIOHTTP,
URL_BASE_V2 as URL_BASE,
URL_CRED_V2 as URL_CRED,
Expand Down Expand Up @@ -73,7 +74,7 @@ async def handle_too_many_requests(rsp: aiohttp.ClientResponse) -> None:


@pytest.mark.skipif(not _DBG_USE_REAL_AIOHTTP, reason="requires vendor's webserver")
async def _test_url_auth_bad0( # invalid server certificate
async def test_url_auth_bad0( # invalid server certificate
client_session: aiohttp.ClientSession,
) -> None:
"""Test authentication flow with invalid server certificate."""
Expand Down Expand Up @@ -194,6 +195,7 @@ async def test_url_auth_bad3( # invalid/expired refresh token


@pytest.mark.skipif(not _DBG_USE_REAL_AIOHTTP, reason="requires vendor's webserver")
@pytest.mark.skipif(not _DBG_TEST_CRED_URLS, reason="invalidates the credentials cache")
async def test_url_auth_good(
client_session: aiohttp.ClientSession,
credentials: tuple[str, str],
Expand Down

0 comments on commit 14b9ed8

Please sign in to comment.