示例#1
0
 def test_make_dir_local(self):
     TEST_DIR = "/tmp/some_dir_123/1234"
     if executor.path_exists(TEST_DIR):
         executor.delete_dir(TEST_DIR)
     executor.make_dirs(TEST_DIR)
     assert os.path.exists(TEST_DIR), "Failed tp create directory {}".format(TEST_DIR)
     shutil.rmtree("/tmp/some_dir_123")
示例#2
0
 def test_remote_download_urls_extract(self):
     executor.delete_dir(REMOTE_TARGET, TEST_DATA.creds)
     wget.download(REMOTE_TARGET, self.urls, creds=TEST_DATA.creds, extract=True)
     act_hash = hasher.get_md5(REMOTE_TARGET, TEST_DATA.creds)
     assert act_hash == TEST_DATA.download_md5_extracted, "remote download failed. Expected: {}, Actual: {}".format(
         TEST_DATA.download_md5, act_hash
     )
示例#3
0
 def test_local_download_urls(self):
     executor.delete_dir(REMOTE_TARGET, TEST_DATA.creds)
     wget.download(LOCAL_TARGET, self.urls)
     act_hash = hasher.get_md5(LOCAL_TARGET)
     assert act_hash == TEST_DATA.download_md5, "local download failed. Expected: {}, Actual: {}".format(
         TEST_DATA.download_md5, act_hash
     )
示例#4
0
 def test_remote_download_urls(self):
     executor.delete_dir(REMOTE_TARGET, TEST_DATA.creds)
     wget.download(REMOTE_TARGET, self.urls, creds=TEST_DATA.creds)
     act_hash = hasher.get_md5(REMOTE_TARGET, TEST_DATA.creds)
     assert act_hash==TEST_DATA.download_md5,\
        'remote download failed. Expected: {}, Actual: {}'\
        .format(TEST_DATA.download_md5, act_hash)
示例#5
0
 def test_download_with_key(self):
     executor.delete_dir(REMOTE_TARGET, TEST_DATA.creds)
     wget.download(REMOTE_TARGET, self.urls, creds=TEST_DATA.creds)
     rsync.download(REMOTE_TARGET, LOCAL_TARGET, creds=TEST_DATA.creds)
     act_hash = hasher.get_md5(REMOTE_TARGET, TEST_DATA.creds)
     assert act_hash == TEST_DATA.download_md5, "upload failed. Expected: {}, Actual: {}".format(
         TEST_DATA.download_md5, act_hash
     )
示例#6
0
 def test_make_dir_local(self):
     TEST_DIR = '/tmp/some_dir_123/1234'
     if executor.path_exists(TEST_DIR):
         executor.delete_dir(TEST_DIR)
     executor.make_dirs(TEST_DIR)
     assert os.path.exists(TEST_DIR),\
         'Failed tp create directory {}'.format(TEST_DIR)
     shutil.rmtree('/tmp/some_dir_123')
示例#7
0
 def test_download_with_key(self):
     executor.delete_dir(REMOTE_TARGET, TEST_DATA.creds)
     wget.download(REMOTE_TARGET, self.urls, creds=TEST_DATA.creds)
     rsync.download(REMOTE_TARGET, LOCAL_TARGET, creds=TEST_DATA.creds)
     act_hash = hasher.get_md5(REMOTE_TARGET, TEST_DATA.creds)
     assert act_hash==TEST_DATA.download_md5,\
        'upload failed. Expected: {}, Actual: {}'\
        .format(TEST_DATA.download_md5, act_hash)