fixing unit test for ref timeseries aggregation - xml file path related
@@ -227,8 +227,9 @@ class RefTimeseriesFileTypeTest(MockIRODSTestCaseMixin, TransactionTestCase,
self.assertEqual(res_file.logical_file_type_name, self.logical_file_type_name)
logical_file = res_file.logical_file
- expected_meta_path = '{}_meta.xml'.format(res_file.file_name)
- expected_map_path = '{}_resmap.xml'.format(res_file.file_name)
+ res_file_name, _ = os.path.splitext(res_file.file_name)
+ expected_meta_path = '{}_meta.xml'.format(res_file_name)
+ expected_map_path = '{}_resmap.xml'.format(res_file_name)
self.assertEqual(logical_file.metadata_short_file_path, expected_meta_path)
self.assertEqual(logical_file.map_short_file_path, expected_map_path)
@@ -242,8 +243,9 @@ class RefTimeseriesFileTypeTest(MockIRODSTestCaseMixin, TransactionTestCase,
res_file = self.composite_resource.files.first()
logical_file = res_file.logical_file
- expected_meta_path = '{0}/{1}_meta.xml'.format(new_folder, res_file.file_name)
- expected_map_path = '{0}/{1}_resmap.xml'.format(new_folder, res_file.file_name)
+ res_file_name, _ = os.path.splitext(res_file.file_name)
+ expected_meta_path = '{0}/{1}_meta.xml'.format(new_folder, res_file_name)
+ expected_map_path = '{0}/{1}_resmap.xml'.format(new_folder, res_file_name)
self.assertEqual(logical_file.metadata_short_file_path, expected_meta_path)
self.assertEqual(logical_file.map_short_file_path, expected_map_path)
@@ -254,8 +256,9 @@ class RefTimeseriesFileTypeTest(MockIRODSTestCaseMixin, TransactionTestCase,
src_path, tgt_path)
res_file = self.composite_resource.files.first()
logical_file = res_file.logical_file
- expected_meta_path = '{0}/{1}_meta.xml'.format(new_folder, res_file.file_name)
- expected_map_path = '{0}/{1}_resmap.xml'.format(new_folder, res_file.file_name)
+ res_file_name, _ = os.path.splitext(res_file.file_name)
+ expected_meta_path = '{0}/{1}_meta.xml'.format(new_folder, res_file_name)
+ expected_map_path = '{0}/{1}_resmap.xml'.format(new_folder, res_file_name)
self.assertEqual(logical_file.metadata_short_file_path, expected_meta_path)
self.assertEqual(logical_file.map_short_file_path, expected_map_path)
@@ -267,8 +270,9 @@ class RefTimeseriesFileTypeTest(MockIRODSTestCaseMixin, TransactionTestCase,
src_path, tgt_path)
res_file = self.composite_resource.files.first()
logical_file = res_file.logical_file
- expected_meta_path = '{0}/{1}_meta.xml'.format(folder_rename, res_file.file_name)
- expected_map_path = '{0}/{1}_resmap.xml'.format(folder_rename, res_file.file_name)
+ res_file_name, _ = os.path.splitext(res_file.file_name)
+ expected_meta_path = '{0}/{1}_meta.xml'.format(folder_rename, res_file_name)
+ expected_map_path = '{0}/{1}_resmap.xml'.format(folder_rename, res_file_name)
self.assertEqual(logical_file.metadata_short_file_path, expected_meta_path)
self.assertEqual(logical_file.map_short_file_path, expected_map_path)
self.composite_resource.delete()
