6464 ),
6565 ),
6666 (
67- "ssh://user@host:22/path/to/file: object" ,
67+ "ssh://user@host:22/path/to/file.root:/ object//path " ,
6868 (
69- "ssh://user@host:22/path/to/file" ,
70- "object" ,
69+ "ssh://user@host:22/path/to/file.root " ,
70+ "object/path " ,
7171 ),
7272 ),
7373 (
74- "ssh://user@host:50230 /path/to/file" ,
74+ "ssh://user@host:22 /path/to/file.root:/object//path:with:colon:in:path/something/ " ,
7575 (
76- "ssh://user@host:50230/path/to/file" ,
76+ "ssh://user@host:22/path/to/file.root" ,
77+ "object/path:with:colon:in:path/something" ,
78+ ),
79+ ),
80+ (
81+ "ssh://user@host:50230/path/to/file.root" ,
82+ (
83+ "ssh://user@host:50230/path/to/file.root" ,
7784 None ,
7885 ),
7986 ),
8087 (
81- "s3://bucket/path/to/file:object" ,
88+ "s3://bucket/path/to/file.root:/dir////object" ,
89+ (
90+ "s3://bucket/path/to/file.root" ,
91+ "dir/object" ,
92+ ),
93+ ),
94+ (
95+ "s3://bucket/path/to/file.root:" ,
8296 (
83- "s3://bucket/path/to/file" ,
84- "object " ,
97+ "s3://bucket/path/to/file.root " ,
98+ "" ,
8599 ),
86100 ),
87101 (
98112 None ,
99113 ),
100114 ),
115+ # https://github.com/scikit-hep/uproot5/issues/975
101116 (
102- "zip://uproot-issue121.root::file:///tmp/pytest-of-runner/pytest-0/test_fsspec_zip0/uproot-issue121.root.zip:Events/MET_pt" ,
117+ "DAOD_PHYSLITE_2023-09-13T1230.art.rntuple.root:RNT:CollectionTree" ,
118+ (
119+ "DAOD_PHYSLITE_2023-09-13T1230.art.rntuple.root" ,
120+ "RNT:CollectionTree" ,
121+ ),
122+ ),
123+ (
124+ "zip://uproot-issue121.root:Events/MET_pt::file:///tmp/pytest-of-runner/pytest-0/test_fsspec_zip0/uproot-issue121.root.zip" ,
103125 (
104126 "zip://uproot-issue121.root::file:///tmp/pytest-of-runner/pytest-0/test_fsspec_zip0/uproot-issue121.root.zip" ,
105127 "Events/MET_pt" ,
106128 ),
107129 ),
108130 (
109- "simplecache::zip://uproot-issue121.root:: file:///tmp/pytest-of-runner/pytest-0/test_fsspec_zip0/uproot-issue121.root.zip:Events/MET_pt " ,
131+ "simplecache::zip://uproot-issue121.root:Events/MET_pt:: file:///tmp/pytest-of-runner/pytest-0/test_fsspec_zip0/uproot-issue121.root.zip" ,
110132 (
111133 "simplecache::zip://uproot-issue121.root::file:///tmp/pytest-of-runner/pytest-0/test_fsspec_zip0/uproot-issue121.root.zip" ,
112134 "Events/MET_pt" ,
113135 ),
114136 ),
115137 (
116- r"zip://uproot-issue121.root:: file://C:\Users\runneradmin\AppData\Local\Temp\pytest-of-runneradmin\pytest-0\test_fsspec_zip0\uproot-issue121.root.zip:Events/MET_pt " ,
138+ r"zip://uproot-issue121.root:Events/MET_pt:: file://C:\Users\runneradmin\AppData\Local\Temp\pytest-of-runneradmin\pytest-0\test_fsspec_zip0\uproot-issue121.root.zip" ,
117139 (
118140 r"zip://uproot-issue121.root::file://C:\Users\runneradmin\AppData\Local\Temp\pytest-of-runneradmin\pytest-0\test_fsspec_zip0\uproot-issue121.root.zip" ,
119141 "Events/MET_pt" ,
120142 ),
121143 ),
144+ (
145+ "zip://uproot-issue121.root:Events/MET_pt::file:///some/weird/path:with:colons/file.root" ,
146+ (
147+ "zip://uproot-issue121.root::file:///some/weird/path:with:colons/file.root" ,
148+ "Events/MET_pt" ,
149+ ),
150+ ),
151+ (
152+ "/some/weird/path:with:colons/file.root:Events/MET_pt" ,
153+ (
154+ "/some/weird/path:with:colons/file.root" ,
155+ "Events/MET_pt" ,
156+ ),
157+ ),
158+ (
159+ "/some/weird/path:with:colons/file.root" ,
160+ (
161+ "/some/weird/path:with:colons/file.root" ,
162+ None ,
163+ ),
164+ ),
122165 ],
123166)
124167def test_url_split (input_value , expected_output ):
@@ -131,9 +174,12 @@ def test_url_split(input_value, expected_output):
131174@pytest .mark .parametrize (
132175 "input_value" ,
133176 [
134- "local/file.root://Events" ,
177+ "local/file.root.zip://Events" ,
178+ "local/file.roo://Events" ,
179+ "local/file://Events" ,
135180 ],
136181)
137182def test_url_split_invalid (input_value ):
138- with pytest .raises (ValueError ):
139- uproot ._util .file_object_path_split (input_value )
183+ path , obj = uproot ._util .file_object_path_split (input_value )
184+ assert obj is None
185+ assert path == input_value
0 commit comments