File tree Expand file tree Collapse file tree 4 files changed +26
-4
lines changed Expand file tree Collapse file tree 4 files changed +26
-4
lines changed Original file line number Diff line number Diff line change 41
41
// "forwardPorts": [],
42
42
43
43
// Use 'postCreateCommand' to run commands after the container is created.
44
- "postCreateCommand" : " pip3 install --user -e .[test ]" ,
44
+ "postCreateCommand" : " pip3 install --user -e .[develop ]" ,
45
45
46
46
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
47
47
"remoteUser" : " vscode"
Original file line number Diff line number Diff line change 98
98
],
99
99
"python.analysis.typeCheckingMode" : " basic" ,
100
100
"python.testing.pytestArgs" : [
101
- " tests"
101
+ " --cov=servicex" ,
102
+ " tests"
102
103
],
103
104
"python.testing.unittestEnabled" : false ,
104
105
"python.testing.pytestEnabled" : true ,
Original file line number Diff line number Diff line change 45
45
logger = logging .getLogger (__name__ )
46
46
47
47
48
- def deliver (config : ServiceXSpec ):
48
+ def deliver (config : ServiceXSpec , config_path = None ):
49
49
def get_codegen (_sample : Sample , _general : General ):
50
50
if _sample .Codegen :
51
51
return _sample .Codegen
52
52
else :
53
53
return _general .Codegen
54
54
55
- sx = ServiceXClient (backend = config .General .ServiceX )
55
+ sx = ServiceXClient (backend = config .General .ServiceX , config_path = config_path )
56
56
datasets = []
57
57
for sample in config .Sample :
58
58
if sample .Query :
Original file line number Diff line number Diff line change 1
1
import pytest
2
+ from unittest .mock import patch
2
3
from pydantic import ValidationError
3
4
4
5
from servicex import ServiceXSpec , FileListDataset , RucioDatasetIdentifier
@@ -150,3 +151,23 @@ def test_invalid_dataset_identifier():
150
151
]
151
152
)
152
153
)
154
+
155
+
156
+ def test_string_query (transformed_result ):
157
+ from servicex import deliver
158
+ spec = ServiceXSpec .model_validate ({
159
+ "General" : {
160
+ "ServiceX" : "testing4" ,
161
+ "Codegen" : "uproot-raw" ,
162
+ },
163
+ "Sample" : [
164
+ {
165
+ "Name" : "sampleA" ,
166
+ "RucioDID" : "user.ivukotic:user.ivukotic.single_top_tW__nominal" ,
167
+ "Query" : "[{'treename': 'nominal'}]"
168
+ }
169
+ ]
170
+ })
171
+ with patch ('servicex.dataset_group.DatasetGroup.as_files' ,
172
+ return_value = [transformed_result ]):
173
+ deliver (spec , config_path = 'tests/example_config.yaml' )
You can’t perform that action at this time.
0 commit comments