当前位置: 首页>>代码示例>>Python>>正文


Python Level.setTopLimit方法代码示例

本文整理汇总了Python中Level.Level.setTopLimit方法的典型用法代码示例。如果您正苦于以下问题:Python Level.setTopLimit方法的具体用法?Python Level.setTopLimit怎么用?Python Level.setTopLimit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Level.Level的用法示例。


在下文中一共展示了Level.setTopLimit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: TestLevel

# 需要导入模块: from Level import Level [as 别名]
# 或者: from Level.Level import setTopLimit [as 别名]
class TestLevel(unittest.TestCase):

    def setUp(self):
        self.levelForTesting = Level(35, 49, "Medium")

    def testGetTopLimit(self):
        testTopLimit = 49
        self.assertEqual(testTopLimit, self.levelForTesting.getTopLimit())

    def testGetBottomLimit(self):
        testTopLimit = 35
        self.assertEqual(testTopLimit, self.levelForTesting.getBottomLimit())

    def testGetNameLevel(self):
        expected = "Medium"
        self.assertEqual(expected, self.levelForTesting.getNameLevel())

    def testSetTopLimit(self):
        expected = 55
        self.levelForTesting.setTopLimit(expected)
        self.assertEqual(expected, self.levelForTesting.getTopLimit())

    def testSetBottomLimit(self):
        expected = 40
        self.levelForTesting.setBottomLimit(expected)
        self.assertEqual(expected, self.levelForTesting.getBottomLimit())

    def testSetNameLevel(self):
        expected = "Hard"
        self.levelForTesting.setNameLevel(expected)
        self.assertEqual(expected, self.levelForTesting.getNameLevel())

    def testDifferenceBetweenTwoLevelsWhenTheyHaveSameValues(self):
        firstLevelForTesting = Level(35, 49, "Medium")
        secondLevelForTesting = Level(35, 49, "Medium")
        self.assertEqual(firstLevelForTesting, secondLevelForTesting)

    def testDifferenceBetweenTwoLevelsWhenTheyHaveDifferentValues(self):
        firstLevelForTesting = Level(35, 49, "Medium")
        secondLevelForTesting = Level(35, 50, "Hard")
        self.assertFalse(firstLevelForTesting == secondLevelForTesting)
开发者ID:AlvaroAvila,项目名称:sudokuD,代码行数:43,代码来源:TestLevel.py

示例2: readDetailsForCustomLevel

# 需要导入模块: from Level import Level [as 别名]
# 或者: from Level.Level import setTopLimit [as 别名]
 def readDetailsForCustomLevel(self):
     """
     This method allows to the user create and use a new customized level
     to generate Sudoku games.
     Note. This level will not be stored in the .xml file
     """
     userLevel = Level(0, 0, "Custom level")
     userLevel.setBottomLimit = int(self.getUserInput("\
     Please enter a number to set the minimun limit for empty spaces"))
     userLevel.setTopLimit = int(self.getUserInput("\
     Please enter a number to set the maximun limit for empty spaces"))
     return userLevel
开发者ID:villarrealp,项目名称:sudokuD,代码行数:14,代码来源:ConsoleMenu.py


注:本文中的Level.Level.setTopLimit方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。