From 3a4f1304b228c559536f7c0d7fa052d7e61b6a56 Mon Sep 17 00:00:00 2001 From: "zhifeng.jiang" Date: Fri, 8 Jul 2016 11:03:22 +0800 Subject: Add some UT test cases and fix pep8 errors for fetchimg JIRA:QTIP-89 Change-Id: I623cd6e48d90996b0199f9b31f86c8844b4d5ceb Signed-off-by: zhifeng.jiang --- func/fetchimg.py | 58 +++++++++++++++++++++++++++----------------------------- 1 file changed, 28 insertions(+), 30 deletions(-) (limited to 'func') diff --git a/func/fetchimg.py b/func/fetchimg.py index 1c621a3b..6cae426e 100644 --- a/func/fetchimg.py +++ b/func/fetchimg.py @@ -1,30 +1,28 @@ -############################################################################## -# Copyright (c) 2015 Dell Inc and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################## - - - -import os -import time - - -class FetchImg: - - def __init__(self): - print 'Fetching Image!' - print 'Fetching QTIP_VM Image' - - def download(self): - time.sleep(2) - os.system( - 'mkdir -p Temp_Img && wget http://artifacts.opnfv.org/qtip/QTIP_CentOS.qcow2 -P Temp_Img') - - filepath = './Temp_Img/QTIP_CentOS.qcow2' - while not os.path.isfile(filepath): - time.sleep(10) - print 'Download Completed!' +############################################################################## +# Copyright (c) 2015 Dell Inc and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +import os +import time + + +class FetchImg: + + def __init__(self): + print 'Fetching Image!' + print 'Fetching QTIP_VM Image' + + @staticmethod + def download(): + time.sleep(2) + os.system( + 'mkdir -p Temp_Img && wget http://artifacts.opnfv.org/qtip/QTIP_CentOS.qcow2 -P Temp_Img') + + filepath = './Temp_Img/QTIP_CentOS.qcow2' + while not os.path.isfile(filepath): + time.sleep(10) + print 'Download Completed!' -- cgit 1.2.3-korg