Delete functest_vacation.py 47/51047/1
authorCédric Ollivier <cedric.ollivier@orange.com>
Wed, 24 Jan 2018 12:49:55 +0000 (13:49 +0100)
committerCédric Ollivier <cedric.ollivier@orange.com>
Wed, 24 Jan 2018 12:49:55 +0000 (13:49 +0100)
Change-Id: Id0e2769a1989e6778ae41f67ed634e2e5002a83d
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
functest/cli/commands/cli_testcase.py
functest/tests/unit/cli/commands/test_cli_testcase.py
functest/utils/functest_vacation.py [deleted file]

index ee7afa5..a424a05 100644 (file)
@@ -16,7 +16,6 @@ import click
 import functest.ci.tier_builder as tb
 from functest.utils.constants import CONST
 import functest.utils.functest_utils as ft_utils
-import functest.utils.functest_vacation as vacation
 
 
 class Testcase(object):
@@ -47,13 +46,10 @@ class Testcase(object):
         if report:
             flags += "-r "
 
-        if testname == 'vacation':
-            vacation.main()
-        else:
-            tests = testname.split(",")
-            for test in tests:
-                cmd = "run_tests {}-t {}".format(flags, test)
-                ft_utils.execute_command(cmd)
+        tests = testname.split(",")
+        for test in tests:
+            cmd = "run_tests {}-t {}".format(flags, test)
+            ft_utils.execute_command(cmd)
 
 
 class CliTestcase(Testcase):
index 72a2708..9ed7d82 100644 (file)
@@ -22,11 +22,6 @@ class CliTestCasesTesting(unittest.TestCase):
         with mock.patch('functest.cli.commands.cli_testcase.tb'):
             self.cli_tests = cli_testcase.CliTestcase()
 
-    @mock.patch('functest.cli.commands.cli_testcase.vacation.main')
-    def test_run_vacation(self, mock_method):
-        self.cli_tests.run('vacation')
-        self.assertTrue(mock_method.called)
-
     @mock.patch('functest.cli.commands.cli_testcase.ft_utils.execute_command')
     def test_run_default(self, mock_ft_utils):
         cmd = "run_tests -n -r -t {}".format(self.testname)
diff --git a/functest/utils/functest_vacation.py b/functest/utils/functest_vacation.py
deleted file mode 100644 (file)
index 71861ba..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-from os import environ
-from curses import initscr, curs_set, newwin, endwin
-from curses import KEY_RIGHT, KEY_LEFT, KEY_DOWN, KEY_UP
-from random import randrange
-
-
-def main():
-    environ["TERM"] = 'Eterm'
-    initscr()
-    curs_set(0)
-    try:
-        win = newwin(16, 60, 0, 0)
-        win.keypad(True)
-        win.nodelay(True)
-        win.border('|', '|', '-', '-', '+', '+', '+', '+')
-        win.addch(4, 44, '@')
-        win.addstr(0, 5, ' Eat all the OPNFV bugs by FunTest! ')
-        win.addstr(15, 7, ' Left,Right,Up,Down: move; other keys: quit ')
-        snake = [[20, 7], [19, 7], [18, 7], [17, 7],
-                 [16, 7], [15, 7], [14, 7], [13, 7]]
-        key = KEY_RIGHT
-        body = '~FUNTEST'
-        ind = 0
-        while key != 27:
-            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], ' ')
-            if win.inch(snake[0][1], snake[0][0]) & 255 == 32:
-                snake.pop()
-            elif win.inch(snake[0][1], snake[0][0]) & 255 == ord('@'):
-                c = [n for n in [[randrange(1, 58, 1), randrange(1, 14, 1)]
-                     for x in range(len(snake))] if n not in snake]
-                win.addch(c == [] and 4 or c[0][1],
-                          c == [] and 44 or c[0][0], '@')
-            else:
-                break
-            ind += 1
-            win.addch(snake[0][1], snake[0][0], body[ind % len(body)])
-    finally:
-        endwin()
-
-    print('\nSnake.PY-26ines by Kris Cieslak (defaultset.blogspot.com).')
-    print('OPNFV adaptation by Functest dream team.')
-    score = str(len(snake) - len(body) - 1)
-    print ('Thanks for playing, your score: %s.' % score)
-    print('Find and fix more bugs in your real OPNFV setup!\n')