File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -95,10 +95,6 @@ def __init__(self,
95
95
status_callback_factory ,
96
96
)
97
97
98
- # Make sure the arguments are reasonable
99
- if backend_type is None and servicex_adaptor is None :
100
- raise ServiceXException ('Specify backend_type or servicex_adaptor' )
101
-
102
98
# Get the local settings
103
99
config = config_adaptor if config_adaptor is not None \
104
100
else ServiceXConfigAdaptor ()
@@ -110,7 +106,6 @@ def __init__(self,
110
106
111
107
if not servicex_adaptor :
112
108
# Given servicex adaptor is none, this should be ok. Fixes type checkers
113
- assert backend_type is not None
114
109
end_point , email , password = config .get_servicex_adaptor_config (backend_type )
115
110
servicex_adaptor = ServiceXAdaptor (end_point , email , password )
116
111
self ._servicex_adaptor = servicex_adaptor
Original file line number Diff line number Diff line change @@ -41,11 +41,19 @@ def test_default_ctor(mocker):
41
41
config .get_default_returned_datatype .assert_called_with ('uproot-ftw' )
42
42
43
43
44
- def test_default_ctor_no_type ():
45
- with pytest .raises (ServiceXException ) as e :
46
- fe .ServiceXDataset ('localds://dude' )
44
+ def test_default_ctor_no_type (mocker ):
45
+ '''Test the default ctor. This requires that a .servicex file be present to work,
46
+ so we are going to dummy it out.
47
+ '''
48
+ config = mocker .MagicMock (spec = ServiceXConfigAdaptor )
49
+ config .settings = Configuration ('servicex' , 'servicex' )
50
+ config .get_servicex_adaptor_config .return_value = ('http://no-way.dude' , 'j@yaol.com' ,
51
+ 'no_spoon_there_is' )
52
+
53
+ fe .ServiceXDataset ('localds://dude' , config_adaptor = config )
47
54
48
- assert "type" in str (e .value )
55
+ config .get_servicex_adaptor_config .assert_called_with (None )
56
+ config .get_default_returned_datatype .assert_called_with (None )
49
57
50
58
51
59
@pytest .mark .asyncio
You can’t perform that action at this time.
0 commit comments