Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Unified Diff: tests/upload_to_google_storage_unittests.py

Issue 1209033006: Revert of Add support for tar.gz archive files to download from download_from_google_storage (Closed) Base URL: http://src.chromium.org/svn/trunk/tools/depot_tools/
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/download_from_google_storage_unittests.py ('k') | upload_to_google_storage.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/upload_to_google_storage_unittests.py
diff --git a/tests/upload_to_google_storage_unittests.py b/tests/upload_to_google_storage_unittests.py
index 9a13e6a6469dfd71bb6945330b0e3f6e3e91341f..3bac038d7402185c3a3a78fff7a4e3f0c4d8159b 100755
--- a/tests/upload_to_google_storage_unittests.py
+++ b/tests/upload_to_google_storage_unittests.py
@@ -11,7 +11,6 @@
import shutil
import StringIO
import sys
-import tarfile
import tempfile
import threading
import unittest
@@ -20,7 +19,6 @@
import upload_to_google_storage
from download_from_google_storage_unittests import GsutilMock
-from download_from_google_storage_unittests import ChangedWorkingDirectory
# ../third_party/gsutil/gsutil
GSUTIL_DEFAULT_PATH = os.path.join(
@@ -64,30 +62,6 @@
'7871c8e24da15bad8b0be2c36edc9dc77e37727f')
os.remove(output_filename)
self.assertEqual(code, 0)
-
- def test_create_archive(self):
- work_dir = os.path.join(self.base_path, 'download_test_data')
- with ChangedWorkingDirectory(work_dir):
- dirname = 'subfolder'
- dirs = [dirname]
- tar_gz_file = '%s.tar.gz' % dirname
- self.assertTrue(upload_to_google_storage.validate_archive_dirs(dirs))
- upload_to_google_storage.create_archives(dirs)
- self.assertTrue(os.path.exists(tar_gz_file))
- with tarfile.open(tar_gz_file, 'r:gz') as tar:
- content = map(lambda x: x.name, tar.getmembers())
- self.assertTrue(dirname in content)
- self.assertTrue(os.path.join(dirname, 'subfolder_text.txt') in content)
- self.assertTrue(
- os.path.join(dirname, 'subfolder_text.txt.sha1') in content)
-
- def test_validate_archive_dirs_fails(self):
- work_dir = os.path.join(self.base_path, 'download_test_data')
- with ChangedWorkingDirectory(work_dir):
- symlink = 'link'
- os.symlink(os.path.join(self.base_path, 'subfolder'), symlink)
- self.assertFalse(upload_to_google_storage.validate_archive_dirs([symlink]))
- self.assertFalse(upload_to_google_storage.validate_archive_dirs(['foobar']))
def test_upload_single_file_remote_exists(self):
filenames = [self.lorem_ipsum]
« no previous file with comments | « tests/download_from_google_storage_unittests.py ('k') | upload_to_google_storage.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698