def setUp(self):
     self.optionOutRangeNumber = 123
     self.optionInRangeNumber = 3
     self.optionChar = 'x'
     self.inputExpected = "5"
     self.myMenu = ConsoleMenu('../Configuration.xml',
                               '../UserDefaultSettings.xml')
class TestConsoleMenu(unittest.TestCase):
    def setUp(self):
        self.optionOutRangeNumber = 123
        self.optionInRangeNumber = 3
        self.optionChar = 'x'
        self.inputExpected = "5"
        self.myMenu = ConsoleMenu('../Configuration.xml',
                                  '../UserDefaultSettings.xml')

    def testValidateUserInputWithOptionInRange(self):
        numberOptions = 4
        self.assertTrue(self.myMenu.isValidSelectedNumberOption(self.optionInRangeNumber,
                                                        numberOptions))

    def testValidateUserInputWithOptionNotInRange(self):
        numberOptions = 4
        self.assertFalse(self.myMenu.isValidSelectedNumberOption(self.optionOutRangeNumber,
                                                         numberOptions))

    def testValidateUserInputWithOptionAsChar(self):
        numberOptions = 4
        self.assertFalse(self.myMenu.isValidSelectedNumberOption(self.optionChar,
                                                         numberOptions))
Exemple #3
0
"""
Author: Pilar Villarreal
Date created: 07/09/2013
Description: Run this file to start the game.
             The menu will be displayed to select game options.
Modified:
                Comments:
Revised by:

"""
from ConsoleMenu import ConsoleMenu
import sys

"""
This file instantiate an object of ConsoleMenu receiving following arguments:
Configuration.xml file which contains the settings selected by user.
UserDefaultSettings.xml file which contains the settings by default of the game.
"""

gameMenu = ConsoleMenu('Configuration.xml','UserDefaultSettings.xml')
gameMenu.mainOptionsMenu()
while True:
    gameMenu.mainOptionsMenu()
Exemple #4
0
"""
Project: AUDIO Steganography
Authors: Dzadíková Slavomíra, Janout Vladimír, Končitý Patrik, Muzikant Petr
"""
from ConsoleMenu import ConsoleMenu

ConsoleMenu()