Skip to content

Commit 08d9916

Browse files
committed
fix cache_key in tests
1 parent 5bc37b8 commit 08d9916

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

tests/test_api/test_http.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import xmltodict
44
import pytest
55
from openml.testing import TestAPIBase
6+
import os
67

78

89
class TestHTTPClient(TestAPIBase):
@@ -11,12 +12,19 @@ def test_cache(self):
1112
params = {"param1": "value1", "param2": "value2"}
1213

1314
key = self.cache.get_key(url, params)
15+
expected_key = os.path.join(
16+
"org",
17+
"openml",
18+
"test",
19+
"api",
20+
"v1",
21+
"task",
22+
"31",
23+
"param1=value1&param2=value2",
24+
)
1425

1526
# validate key
16-
self.assertEqual(
17-
key,
18-
"org/openml/test/api/v1/task/31/param1=value1&param2=value2",
19-
)
27+
self.assertEqual(key, expected_key)
2028

2129
# create fake response
2230
req = Request("GET", url).prepare()

0 commit comments

Comments
 (0)