Fix autoupdate_unittest and xbuddy_unittest.
BUG=None
TEST=Unittest
Change-Id: I7d91516628bc826a54d4dc67ebe40321cfb31ede
Reviewed-on: https://gerrit.chromium.org/gerrit/66145
Commit-Queue: Joy Chen <joychen@chromium.org>
Reviewed-by: Joy Chen <joychen@chromium.org>
Tested-by: Joy Chen <joychen@chromium.org>
diff --git a/autoupdate_unittest.py b/autoupdate_unittest.py
index 9fe04b5..35de73c 100755
--- a/autoupdate_unittest.py
+++ b/autoupdate_unittest.py
@@ -147,11 +147,7 @@
with open(forced_image, 'w') as fh:
fh.write('')
- static_forced_image_dir = os.path.join(self.static_image_dir,
- 'forced_image')
- static_forced_image = os.path.join(static_forced_image_dir,
- constants.IMAGE_FILE)
- cache_image_dir = os.path.join(static_forced_image_dir, 'cache')
+ cache_image_dir = os.path.join(self.static_image_dir, 'cache')
# Mock out GenerateUpdateImageWithCache to make an update file in cache
def mock_fn(_image, static_image_dir):
@@ -164,8 +160,8 @@
fh.write('')
common_util.IsInsideChroot().AndReturn(True)
- au_mock.GenerateUpdateImageWithCache(static_forced_image,
- static_image_dir=static_forced_image_dir).WithSideEffects(
+ au_mock.GenerateUpdateImageWithCache(forced_image,
+ static_image_dir=self.static_image_dir).WithSideEffects(
mock_fn).AndReturn('cache')
common_util.GetFileSha1(os.path.join(
@@ -177,7 +173,7 @@
au_mock._StoreMetadataToFile(cache_image_dir,
mox.IsA(autoupdate.UpdateMetadata))
forced_url = 'http://%s/static/%s/update.gz' % (self.hostname,
- 'forced_image/cache')
+ 'cache')
autoupdate_lib.GetUpdateResponse(
self.sha1, self.sha256, self.size, forced_url, False, '3.0',
False).AndReturn(self.payload)
diff --git a/xbuddy.py b/xbuddy.py
index 1ee0f8c..d0e72bd 100644
--- a/xbuddy.py
+++ b/xbuddy.py
@@ -316,7 +316,7 @@
# Determine if image is explicitly local or remote.
is_local = True
if path_list[0] in (REMOTE, LOCAL):
- is_local = (path_list.pop(0) == REMOTE)
+ is_local = (path_list.pop(0) == LOCAL)
# Set board.
board = path_list.pop(0)
@@ -401,7 +401,7 @@
try:
_Log("Downloading '%s' from '%s'", artifact, gs_url)
downloader.Downloader(self.static_dir, gs_url).Download(
- [artifact])
+ [artifact], [])
finally:
with XBuddy._staging_thread_count_lock:
XBuddy._staging_thread_count -= 1