|
9 | 9 | import pathlib
|
10 | 10 | import fsspec
|
11 | 11 | import numpy as np
|
| 12 | +import awkward as ak |
12 | 13 |
|
13 | 14 | is_windows = sys.platform.startswith("win")
|
14 | 15 |
|
@@ -218,3 +219,22 @@ def test_fsspec_writing_memory(tmp_path, scheme):
|
218 | 219 |
|
219 | 220 | with uproot.open(uri) as f:
|
220 | 221 | assert f["tree"]["x"].array().tolist() == [1, 2, 3]
|
| 222 | + |
| 223 | + |
| 224 | +def test_write_append_fsspec_xrootd(xrootd_server): |
| 225 | + remote_path, _ = xrootd_server |
| 226 | + filename = "file.root" |
| 227 | + remote_file_path = os.path.join(remote_path, filename) |
| 228 | + array = ak.Array({"x": [1, 2, 3], "y": [4, 5, 6]}) |
| 229 | + file = uproot.recreate(remote_file_path) |
| 230 | + file["tree"] = array |
| 231 | + file.close() |
| 232 | + array2 = ak.Array({"x": [1, 2, 3, 4], "y": [4, 5, 6, 7]}) |
| 233 | + file = uproot.update(remote_file_path) |
| 234 | + file["other_tree"] = array2 |
| 235 | + file.close() |
| 236 | + with uproot.open(remote_file_path) as f: |
| 237 | + assert f["tree"]["x"].array().tolist() == [1, 2, 3] |
| 238 | + assert f["tree"]["y"].array().tolist() == [4, 5, 6] |
| 239 | + assert f["other_tree"]["x"].array().tolist() == [1, 2, 3, 4] |
| 240 | + assert f["other_tree"]["y"].array().tolist() == [4, 5, 6, 7] |
0 commit comments