def test_returned_datatype_no_type_endpoint(): c = ConfigSettings('servicex', 'servicex') c.clear() c['backend_types'] = [{'type': 'forkit', 'return_data': 'spoon'}] c['api_endpoints'] = [{'endpoint': 'http://localhost:5000'}] x = ServiceXConfigAdaptor(c) assert x.get_default_returned_datatype('forkit') == 'spoon'
def test_returned_datatype_default(): c = ConfigSettings('servicex', 'servicex') c.clear() c['default_return_data'] = 'root' x = ServiceXConfigAdaptor(c) assert x.get_default_returned_datatype(None) == 'root'
def test_returned_datatype_from_default_dict(): c = ConfigSettings('servicex', 'servicex') c.clear() c['backend_types'] = [{'type': 'forkit', 'return_data': 'spoon'}] x = ServiceXConfigAdaptor(c) assert x.get_default_returned_datatype('forkit') == 'spoon'
def test_returned_datatype_nothing(): c = ConfigSettings('servicex', 'servicex') c.clear() x = ServiceXConfigAdaptor(c) with pytest.raises(ServiceXException): x.get_default_returned_datatype(None)