Skip to content

Commit e53d9c8

Browse files
committed
Apply json_impl fix in tests from fsspec#1613
1 parent d7d2549 commit e53d9c8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

fsspec/implementations/tests/test_reference.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ def test_defaults(server): # noqa: F811
229229

230230
def test_spec1_expand():
231231
pytest.importorskip("jinja2")
232+
from fsspec.implementations.reference import json as json_impl
232233
in_data = {
233234
"version": 1,
234235
"templates": {"u": "server.domain/path", "f": "{{c}}"},
@@ -264,7 +265,7 @@ def test_spec1_expand():
264265
"key2": ["http://server.domain/path", 10000, 100],
265266
"key3": ["http://text", 10000, 100],
266267
"key4": ["http://target_url"],
267-
"key5": '{"key": "value"}',
268+
"key5": json_impl.dumps(in_data["refs"]["key5"]),
268269
"gen_key0": ["http://server.domain/path_0", 1000, 1000],
269270
"gen_key1": ["http://server.domain/path_1", 2000, 1000],
270271
"gen_key2": ["http://server.domain/path_2", 3000, 1000],
@@ -277,6 +278,7 @@ def test_spec1_expand():
277278

278279
def test_spec1_expand_simple():
279280
pytest.importorskip("jinja2")
281+
from fsspec.implementations.reference import json as json_impl
280282
in_data = {
281283
"version": 1,
282284
"templates": {"u": "server.domain/path"},
@@ -297,7 +299,7 @@ def test_spec1_expand_simple():
297299
)
298300
assert fs.references["key2"] == ["http://not.org/p", 10000, 100]
299301
assert fs.cat("key0") == b"data"
300-
assert fs.cat("key5") == b'{"key": "value"}'
302+
assert fs.cat("key5") == json_impl.dumps(in_data["refs"]["key5"]).encode("utf-8")
301303

302304

303305
def test_spec1_gen_variants():

0 commit comments

Comments
 (0)