Пример #1
0
 def __derive_filtered_file_path(self):
     file_path, full_file_name = split(abspath(self.input_file_path))
     file_name = full_file_name.split('.')[0]
     time_milliseconds = int(time.time() * 1000)
     filtered_file_path = join(file_path, file_name + '-filtered-' + str(time_milliseconds) +
                               get_extension(self.compression_type))
     return filtered_file_path
 def __generate_file_name(self):
     if str(FeedScope.BOOTSTRAP) == self.feed_scope:
         feed_prefix = str(FeedPrefix.BOOTSTRAP)
     elif str(FeedScope.DAILY) == self.feed_scope:
         feed_prefix = str(FeedPrefix.DAILY)
     else:
         raise InputDataError('Unknown feed scope', self.feed_scope)
     file_name = str(FeedType.ITEM) + '_' + feed_prefix + '_' + str(self.category_id) + '_' + self.feed_date + \
         '_' + self.marketplace_id + file_utils.get_extension(self.file_format)
     return file_name
Пример #3
0
 def test_get_file_extension(self):
     ext = file_utils.get_extension(FileFormat.GZIP.value)
     self.assertEqual(ext, '.gz')
Пример #4
0
 def test_get_file_extension_none(self):
     ext = file_utils.get_extension(None)
     self.assertEqual(ext, '')