aboutsummaryrefslogtreecommitdiffstats
path: root/functest/utils/functest_vacation.py
diff options
context:
space:
mode:
authorhelenyao <yaohelan@huawei.com>2016-11-21 06:50:06 -0500
committerjose.lausuch <jose.lausuch@ericsson.com>2016-11-24 15:14:45 +0100
commit3e3c96b2aa15d7757f281ce00518a67e2a1225a9 (patch)
tree9b15e0ceab33a9301ca7cde1a0a36e05f2347584 /functest/utils/functest_vacation.py
parent7a776398ef8b17bd9af5367d712707a903c1c86a (diff)
Extracted all global parameters into functest_constants.py
JIRA: FUNCTEST-533 1. Extracted all global variables into functest_constants.py and updated all affected areas accordingly 2. Used os.path.join to replace '/' to come up with the path for better cross-platform support and improve the path accuracy 3. Removed unused variables 4. Updated the hardcoded path in Dockerfile by using variable reference 5. Removed "/" ending from all path variables 6. Updated the unit test Change-Id: Ib30a81d1f0c83fbaef042d63c187c27bd18301bb Signed-off-by: helenyao <yaohelan@huawei.com>
Diffstat (limited to 'functest/utils/functest_vacation.py')
-rw-r--r--functest/utils/functest_vacation.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/functest/utils/functest_vacation.py b/functest/utils/functest_vacation.py
index 0ba09447..6c7312fa 100644
--- a/functest/utils/functest_vacation.py
+++ b/functest/utils/functest_vacation.py
@@ -22,16 +22,16 @@ def main():
body = '~FUNTEST'
ind = 0
while key != 27:
- win.addstr(0, 44, ' Score: '+str(len(snake)-len(body))+' ')
+ win.addstr(0, 44, ' Score: ' + str(len(snake) - len(body)) + ' ')
win.timeout(140 - 2 * len(snake))
getkey = win.getch()
key = key if getkey == -1 else getkey
snake.insert(
- 0, [snake[0][0]+(key == KEY_RIGHT and 1 or
- key == KEY_LEFT and -1),
- snake[0][1]+(key == KEY_DOWN and 1 or
- key == KEY_UP and -1)])
- win.addch(snake[len(snake)-1][1], snake[len(snake)-1][0], ' ')
+ 0, [snake[0][0] + (key == KEY_RIGHT and 1 or
+ key == KEY_LEFT and -1),
+ snake[0][1] + (key == KEY_DOWN and 1 or
+ key == KEY_UP and -1)])
+ win.addch(snake[len(snake) - 1][1], snake[len(snake) - 1][0], ' ')
if win.inch(snake[0][1], snake[0][0]) & 255 == 32:
snake.pop()
elif win.inch(snake[0][1], snake[0][0]) & 255 == ord('@'):
@@ -48,5 +48,6 @@ def main():
print '\nSnake.PY-26lines by Kris Cieslak (defaultset.blogspot.com).'
print 'OPNFV adaptation by Functest dream team.'
- print 'Thanks for playing, your score: '+str(len(snake)-len(body)-1)+'.'
+ print 'Thanks for playing, your score: ' + \
+ str(len(snake) - len(body) - 1) + '.'
print 'Find and fix more bugs in your real OPNFV setup!\n'