5
5
import logging
6
6
from datetime import UTC , datetime as dt , timedelta as td
7
7
from http import HTTPMethod , HTTPStatus
8
- from typing import TYPE_CHECKING , Final
8
+ from typing import TYPE_CHECKING
9
9
10
10
import pytest
11
11
from aioresponses import aioresponses
12
12
from cli .auth import CredentialsManager
13
13
14
- from evohome .const import HINT_BAD_CREDS , HINT_CHECK_NETWORK
15
14
from evohomeasync2 import EvohomeClient , exceptions as exc
16
15
from tests .const import (
17
16
HEADERS_BASE ,
21
20
URL_CRED_V2 ,
22
21
)
23
22
23
+ from .const import LOG_00 , LOG_01 , LOG_02 , LOG_03 , LOG_04 , LOG_11 , LOG_12 , LOG_13
24
+
24
25
if TYPE_CHECKING :
25
26
from collections .abc import AsyncGenerator
26
27
from pathlib import Path
27
28
28
29
from cli .auth import CredentialsManager
29
30
30
31
31
- MSG_INVALID_TOKEN : Final = (
32
- "The access_token has been rejected (will re-authenticate): " # noqa: S105
33
- "GET https://tccna.resideo.com/WebAPI/emea/api/v1/userAccount: "
34
- '401 Unauthorized, response=[{"code": "Unauthorized", "message": "Unauthorized"}]'
35
- )
36
-
37
32
_TEST_ACCESS_TOKEN = "-- access token --" # noqa: S105
38
33
_TEST_REFRESH_TOKEN = "-- refresh token --" # noqa: S105
39
34
@@ -46,18 +41,6 @@ def cache_file(
46
41
return tmp_path_factory .mktemp (__name__ ) / ".evo-cache.tst"
47
42
48
43
49
- LOG_00 = ("evohomeasync2" , logging .WARNING , MSG_INVALID_TOKEN )
50
-
51
- LOG_01 = ("evohome.credentials" , logging .DEBUG , "Fetching access_token..." )
52
- LOG_02 = ("evohome.credentials" , logging .DEBUG , " - authenticating with the refresh_token" ) # fmt: off
53
- LOG_03 = ("evohome.credentials" , logging .DEBUG , "Expired/invalid refresh_token" )
54
- LOG_04 = ("evohome.credentials" , logging .DEBUG , " - authenticating with client_id/secret" ) # fmt: off
55
-
56
- LOG_11 = ("evohome.credentials" , logging .ERROR , HINT_BAD_CREDS )
57
- LOG_12 = ("evohome.credentials" , logging .ERROR , HINT_CHECK_NETWORK )
58
-
59
- LOG_13 = ("evohome.auth" , logging .ERROR , HINT_CHECK_NETWORK )
60
-
61
44
POST_CREDS = (
62
45
"https://tccna.resideo.com/Auth/OAuth/Token" ,
63
46
HTTPMethod .POST ,
0 commit comments