From d28b609e1796dc23d88ccb5ea79f91fc387672d3 Mon Sep 17 00:00:00 2001 From: Massimiliano Galli Date: Thu, 13 Feb 2025 15:37:35 +0100 Subject: [PATCH] add test to check that we can write via xrootd --- tests/test_0692_fsspec_writing.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/test_0692_fsspec_writing.py b/tests/test_0692_fsspec_writing.py index 16cb2a9b4..8e2c842e7 100644 --- a/tests/test_0692_fsspec_writing.py +++ b/tests/test_0692_fsspec_writing.py @@ -9,6 +9,7 @@ import pathlib import fsspec import numpy as np +import awkward as ak is_windows = sys.platform.startswith("win") @@ -218,3 +219,16 @@ def test_fsspec_writing_memory(tmp_path, scheme): with uproot.open(uri) as f: assert f["tree"]["x"].array().tolist() == [1, 2, 3] + + +def test_write_fsspec_xrootd(xrootd_server): + remote_path, _ = xrootd_server + filename = "file.root" + remote_file_path = os.path.join(remote_path, filename) + array = ak.Array({"x":[1,2,3], "y":[4,5,6]}) + file = uproot.recreate(remote_file_path) + file["tree"] = array + file.close() + with uproot.open(remote_file_path) as f: + assert f["tree"]["x"].array().tolist() == [1, 2, 3] + assert f["tree"]["y"].array().tolist() == [4, 5, 6] \ No newline at end of file