From f6ed56897103e72048511c011941587c9c9cbed1 Mon Sep 17 00:00:00 2001 From: John Chilton Date: Thu, 4 Jan 2018 14:23:49 -0500 Subject: [PATCH] Clarify some FTP purging behaviors with tests. xref https://github.com/galaxyproject/galaxy/pull/5264#issuecomment-355373614 --- test/integration/test_upload_configuration_options.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/test/integration/test_upload_configuration_options.py b/test/integration/test_upload_configuration_options.py index d5f6789723c..6ca827ddebe 100644 --- a/test/integration/test_upload_configuration_options.py +++ b/test/integration/test_upload_configuration_options.py @@ -257,13 +257,13 @@ class SimpleFtpUploadConfigurationTestCase(BaseFtpUploadConfigurationTestCase): assert len(ftp_files) == 1, ftp_files assert ftp_files[0]["path"] == "test" assert os.path.exists(ftp_path) + # set to_posix_lines to None to exercise purging - by default this file type wouldn't + # be purged. dataset = self.dataset_populator.new_dataset( - self.history_id, ftp_files="test", file_type="txt", wait=True + self.history_id, ftp_files="test", file_type="txt", to_posix_lines=None, wait=True ) self._check_content(dataset, content) - # Purge is set by default so this should be gone. - # ... but it isn't - is this a bug? Are only certain kinds of uploads purged? - # assert not os.path.exists(ftp_path) + assert not os.path.exists(ftp_path) def _get_user_ftp_path(self): return os.path.join(self.ftp_dir(), TEST_USER) @@ -311,8 +311,9 @@ class DisableFtpPurgeUploadConfigurationTestCase(BaseFtpUploadConfigurationTestC assert len(ftp_files) == 1 assert ftp_files[0]["path"] == "test" assert os.path.exists(ftp_path) + # gotta set to_posix_lines to None currently to force purging of non-binary data. dataset = self.dataset_populator.new_dataset( - self.history_id, ftp_files="test", file_type="txt", wait=True + self.history_id, ftp_files="test", file_type="txt", to_posix_lines=None, wait=True ) self._check_content(dataset, content) # Purge is disabled, this better still be here.