diff options
author | spisarski <s.pisarski@cablelabs.com> | 2017-05-12 13:59:04 -0600 |
---|---|---|
committer | spisarski <s.pisarski@cablelabs.com> | 2017-05-16 14:21:56 -0600 |
commit | 10c665d7c831cf198ac9e675654693860e602bf9 (patch) | |
tree | b30f75115e80ddc983b9e3555b165992cef234c1 /snaps/file_utils.py | |
parent | 6fd1af82cd7bf41274c4e1620006004b79628759 (diff) |
Added support for offline testing
Expanded the image_metadata used by the tests for overriding default
images for not only supporting 3part images but also to support offline
testing as required by Functest.
JIRA: SNAPS-67
Change-Id: I6975e7b51fa879fe984af64402939c465df95184
Signed-off-by: spisarski <s.pisarski@cablelabs.com>
Diffstat (limited to 'snaps/file_utils.py')
-rw-r--r-- | snaps/file_utils.py | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/snaps/file_utils.py b/snaps/file_utils.py index a321cc2..7b93a6d 100644 --- a/snaps/file_utils.py +++ b/snaps/file_utils.py @@ -42,21 +42,12 @@ def file_exists(file_path): return False -def get_file(file_path): - """ - Returns True if the image file has already been downloaded - :return: the image file object - :raise Exception when file cannot be found - """ - if file_exists(file_path): - return open(file_path, 'rb') - else: - raise Exception('File with path cannot be found - ' + file_path) - - def download(url, dest_path, name=None): """ Download a file to a destination path given a URL + :param url: the endpoint to the file to download + :param dest_path: the directory to save the file + :param name: the file name (optional) :rtype : File object """ if not name: |