flash: Default static dir fixes.
* Replace flash.DEVSERVER_STATIC_DIR with
dev_server_wrapper.DEFAULT_STATIC_DIR
* lookup_only was not used.
* Make version a required argument in GetImagePathWithXbuddy.
* static_dir optional for TranslatedPathToLocalPath.
* CreateStaticDirectory similar to WipeStaticDirectory.
BUG=chromium:1070566
TEST=cros flash, unittests
Change-Id: I67b574473d783e3c3aadeed56241e46fd47050c5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/chromite/+/2177007
Reviewed-by: Achuith Bhandarkar <achuith@chromium.org>
Reviewed-by: Amin Hassani <ahassani@chromium.org>
Commit-Queue: Achuith Bhandarkar <achuith@chromium.org>
Tested-by: Achuith Bhandarkar <achuith@chromium.org>
diff --git a/cli/flash_unittest.py b/cli/flash_unittest.py
index 7674d5c..ba59c54 100644
--- a/cli/flash_unittest.py
+++ b/cli/flash_unittest.py
@@ -111,7 +111,7 @@
ret for paths under devserver/static, and the expected value of
os.path.exists otherwise.
"""
- if path.startswith(flash.DEVSERVER_STATIC_DIR):
+ if path.startswith(dev_server_wrapper.DEFAULT_STATIC_DIR):
return ret
return os.access(path, os.F_OK)
@@ -155,10 +155,8 @@
# Call to download full_payload and stateful. No other calls.
mock_xbuddy.assert_has_calls(
- [mock.call('/path/to/image/full_payload', mock.ANY, mock.ANY,
- static_dir=flash.DEVSERVER_STATIC_DIR, silent=True),
- mock.call('/path/to/image/stateful', mock.ANY, mock.ANY,
- static_dir=flash.DEVSERVER_STATIC_DIR, silent=True)])
+ [mock.call('/path/to/image/full_payload', 'board', None, silent=True),
+ mock.call('/path/to/image/stateful', 'board', None, silent=True)])
self.assertEqual(mock_xbuddy.call_count, 2)
def testTestImage(self):
@@ -174,10 +172,8 @@
# Call to download full_payload and image. No other calls.
mock_xbuddy.assert_has_calls(
- [mock.call('/path/to/image/full_payload', mock.ANY, mock.ANY,
- static_dir=flash.DEVSERVER_STATIC_DIR, silent=True),
- mock.call('/path/to/image', mock.ANY, mock.ANY,
- static_dir=flash.DEVSERVER_STATIC_DIR)])
+ [mock.call('/path/to/image/full_payload', 'board', None, silent=True),
+ mock.call('/path/to/image', 'board', None)])
self.assertEqual(mock_xbuddy.call_count, 2)