@@ -8,7 +8,15 @@ def authenticate(self, apiKey):
88 return True
99
1010 def resourceLookup (self , path ):
11- return {'_id' : 'fake_id' , '_modelType' : 'folder' }
11+ if path == '/vip/Home/test-VipLauncher-Backup/OUTPUTS' :
12+ # Used to test the backup location, linked to the fake fetFolder method
13+ print ("FakeGirderClient: resourceLookup called with path:" , path )
14+ return {'_id' : 'fake_id' , '_modelType' : 'folder' }
15+ elif path == '/vip/Home/test-VipLauncher-Backup-Special/OUTPUTS' :
16+ print ("FakeGirderClient: resourceLookup called with path:" , path )
17+ return {'_id' : 'different_id' , '_modelType' : 'folder' }
18+ else :
19+ return {'_id' : 'other_id' , '_modelType' : 'folder' }
1220
1321 def createFolder (self , parentId , name , reuseExisting = True , ** kwargs ):
1422 return {'_id' : 'fake_id' }
@@ -17,18 +25,42 @@ def addMetadataToFolder(self, folderId, metadata):
1725 return True
1826
1927 def getFolder (cls , folderId ):
20- metadata = {
21- 'input_settings' : {
22- 'zipped_folder' : 'fake_value' ,
23- 'basis_file' : 'fake_value' ,
24- 'signal_file' : ['fake_value' , 'fake_value' ],
25- 'control_file' : ['fake_value' ]},
26- "pipeline_id" : cls .pipeline_id ,
27- 'session_name' : 'test-VipLauncher' ,
28- 'workflows' : {},
29- "vip_output_dir" : "/vip/Home/test-VipLauncher/OUTPUTS"
30- }
31- return {'_id' : 'fake_id' , 'meta' : metadata }
28+ if folderId == 'fake_id' :
29+ print ("FakeGirderClient: getFolder called with folderId:" , folderId )
30+ metadata = {
31+ 'input_settings' : {
32+ 'zipped_folder' : 'fake_value1' ,
33+ 'basis_file' : 'fake_value2' ,
34+ 'signal_file' : ['fake_value3' , 'fake_value4' ],
35+ 'control_file' : ['fake_value5' ]
36+ },
37+ "pipeline_id" : cls .pipeline_id ,
38+ 'session_name' : 'test-VipLauncher' ,
39+ 'workflows' : {},
40+ "vip_output_dir" : "/vip/Home/test-VipLauncher-Backup/OUTPUTS" ,
41+ 'output_location' : 'girder' ,
42+ 'local_output_dir' : '/path/to/local/output' ,
43+ }
44+ return {'_id' : 'fake_id' , 'meta' : metadata }
45+ elif folderId == 'different_id' :
46+ print ("FakeGirderClient: getFolder called with folderId:" , folderId )
47+ metadata = {
48+ 'input_settings' : {
49+ 'zipped_folder' : 'different_value1' ,
50+ 'basis_file' : 'different_value2' ,
51+ 'signal_file' : ['different_value3' , 'different_value4' ],
52+ 'control_file' : ['different_value5' ]
53+ },
54+ "pipeline_id" : cls .pipeline_id ,
55+ 'session_name' : 'test-VipLauncher-Special' ,
56+ 'workflows' : {},
57+ "vip_output_dir" : "/vip/Home/test-VipLauncher-Backup-Special/OUTPUTS" ,
58+ 'output_location' : 'girder' ,
59+ 'local_output_dir' : '/path/to/local/output' ,
60+ }
61+ return {'_id' : 'different_id' , 'meta' : metadata }
62+ else :
63+ return {'_id' : 'fake_id' , 'meta' : {}}
3264
3365 def get (self , path ):
3466 return {'_id' : 'fake_id' }
0 commit comments