Skip to content

Commit a102b28

Browse files
committed
Create constant in test
1 parent e434d31 commit a102b28

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

tests/test_states.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@
1818
from . import load_fixture
1919

2020

21+
OPENSKY_URL = "python_opensky-network.org"
22+
2123
async def test_states(
2224
aresponses: ResponsesMockServer,
2325
) -> None:
2426
"""Test retrieving states."""
2527
aresponses.add(
26-
"python_opensky-network.org",
28+
OPENSKY_URL,
2729
"/api/states/all",
2830
"GET",
2931
aresponses.Response(
@@ -64,7 +66,7 @@ async def test_new_session(
6466
) -> None:
6567
"""Test that it creates a new session if not given one."""
6668
aresponses.add(
67-
"python_opensky-network.org",
69+
OPENSKY_URL,
6870
"/api/states/all",
6971
"GET",
7072
aresponses.Response(
@@ -89,7 +91,7 @@ async def response_handler(_: aiohttp.ClientResponse) -> Response:
8991
return aresponses.Response(body="Goodmorning!")
9092

9193
aresponses.add(
92-
"python_opensky-network.org",
94+
OPENSKY_URL,
9395
"/api/states/all",
9496
"GET",
9597
response_handler,
@@ -110,7 +112,7 @@ async def response_handler(_: aiohttp.ClientResponse) -> Response:
110112
raise ClientError
111113

112114
aresponses.add(
113-
"python_opensky-network.org",
115+
OPENSKY_URL,
114116
"/api/states/all",
115117
"GET",
116118
response_handler,
@@ -128,7 +130,7 @@ async def test_unexpected_server_response(
128130
) -> None:
129131
"""Test handling a server error."""
130132
aresponses.add(
131-
"python_opensky-network.org",
133+
OPENSKY_URL,
132134
"/api/states/all",
133135
"GET",
134136
aresponses.Response(

0 commit comments

Comments
 (0)