I was looking into consolidating tests and I realized that this test has different behavior on swift vs. local filesystem. Specifically, if you use copytree or copy or open, parent directories are auto-created on OBS but not on POSIX:
folder = stor.join(container, 'analysis')
subfolder = stor.join(container, 'analysis', 'alignments')
file_in_folder = stor.join(container, 'analysis', 'alignments',
'bam.bam')
self.assertFalse(stor.exists(file_in_folder))
self.assertFalse(stor.isdir(folder))
self.assertFalse(stor.isdir(folder + '/'))
with stor.open(file_with_prefix, 'w') as fp:
fp.write('data\n')
self.assertFalse(stor.isdir(folder))
self.assertTrue(stor.isfile(file_with_prefix))
If we wanted to actually have cross-compatible behavior, I'm thinking we should make an API break and then have open(), copy(), copytree() all create parent directories for you (again, to provide consistency).
Thoughts @pkaleta @kyleabeauchamp @wesleykendall ?
I was looking into consolidating tests and I realized that this test has different behavior on swift vs. local filesystem. Specifically, if you use copytree or copy or open, parent directories are auto-created on OBS but not on POSIX:
If we wanted to actually have cross-compatible behavior, I'm thinking we should make an API break and then have open(), copy(), copytree() all create parent directories for you (again, to provide consistency).
Thoughts @pkaleta @kyleabeauchamp @wesleykendall ?