Spaces:
Runtime error
Runtime error
File size: 541 Bytes
63deadc |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
import fsspec
def test_1():
with fsspec.open("data:text/plain;base64,SGVsbG8sIFdvcmxkIQ==") as f:
assert f.read() == b"Hello, World!"
with fsspec.open("data:,Hello%2C%20World%21") as f:
assert f.read() == b"Hello, World!"
def test_info():
fs = fsspec.filesystem("data")
info = fs.info("data:text/html,%3Ch1%3EHello%2C%20World%21%3C%2Fh1%3E")
assert info == {
"name": "%3Ch1%3EHello%2C%20World%21%3C%2Fh1%3E",
"size": 22,
"type": "file",
"mimetype": "text/html",
}
|