Skip to content
Snippets Groups Projects
Commit 9e03d88f authored by Christoph Heidecker's avatar Christoph Heidecker
Browse files

bug fix for non-root path input strings

parent fc653dbd
Branches
No related tags found
No related merge requests found
Pipeline #
......@@ -127,7 +127,9 @@ def get_files_to_search_from_data(queue_logging, thread_num, data):
# if it is still empty it should have read all -> break loop
break
try:
files_to_search_array.append("/" + ((data.split('root://', 1)[1]).split("//", 1)[1]))
splittedString = data.split('root://', 1)
if len(splittedString) > 1:
files_to_search_array.append("/" + ((splittedString[1]).split("//", 1)[1]))
except Exception as e:
queue_logging.put("WARNI: " + str(thread_num) + ": Failed to append "
+ str(("/" + ((data.split('root://', 1)[1]).split("//", 1)[1])))
......
......@@ -68,7 +68,14 @@ class TestGenerateFileList(TestCase):
files_to_search_array, input_tmp = get_files_to_search_from_data(self.logger, self.thread_num, data)
self.assertEqual(files_to_search_array, ['/address2', '/address3'])
self.assertEqual(input_tmp, expected_input_tmp)
data = "file://PreRAWskimmed_53632.root"
expected_input_tmp = "file://PreRAWskimmed_53632.root"
files_to_search_array, input_tmp = get_files_to_search_from_data(self.logger, self.thread_num, data)
print(files_to_search_array, input_tmp)
self.assertEqual(files_to_search_array, [])
self.assertEqual(input_tmp, expected_input_tmp)
self.logger.put("DEBUG: Tested function: 'test_get_files_to_search_from_data' appears to be fine.")
return
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment