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


Python MobberManager.move_mobber_up方法代码示例

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


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

示例1: test_add_4_mobbers_move_up_top

# 需要导入模块: from Infrastructure.MobberManager import MobberManager [as 别名]
# 或者: from Infrastructure.MobberManager.MobberManager import move_mobber_up [as 别名]
 def test_add_4_mobbers_move_up_top(self):
     mobber_manager = MobberManager()
     mobber_manager.add_mobber("Joe")
     mobber_manager.add_mobber("Chris")
     mobber_manager.add_mobber("Will")
     mobber_manager.add_mobber("Eric")
     mobber_manager.move_mobber_up(0)
     result = ["Eric", "Chris", "Will", "Joe"]
     self.assertEqual(mobber_manager.get_mobbers(), result)
开发者ID:MobProgramming,项目名称:MobTimer.Python,代码行数:11,代码来源:TestsMobberManager.py

示例2: test_subscribe_to_mobber_list_changes

# 需要导入模块: from Infrastructure.MobberManager import MobberManager [as 别名]
# 或者: from Infrastructure.MobberManager.MobberManager import move_mobber_up [as 别名]
    def test_subscribe_to_mobber_list_changes(self):
        mobber_manager = MobberManager()
        result = {"result": "Mobbers in List for Each Change\n", "increment": 0}

        def time_change_callback(mobber_list, driver_index, navigator_index):
            result["increment"] += 1
            result["result"] += "Action " + result["increment"].__str__() + ":"
            for mobber_index in range(0, mobber_list.__len__()):
                result["result"] += mobber_list[mobber_index]
                if mobber_index == driver_index:
                    result["result"] += " (Driver)"
                if mobber_index == navigator_index:
                    result["result"] += " (Navigator)"
                result["result"] += ", "

            result["result"] += "\n"

        mobber_manager.subscribe_to_mobber_list_change(time_change_callback)

        mobber_manager.add_mobber("Joe")
        mobber_manager.add_mobber("Chris")
        mobber_manager.add_mobber("Sam")
        mobber_manager.add_mobber("John")
        mobber_manager.switch_next_driver()
        mobber_manager.add_mobber("Bill")
        mobber_manager.switch_next_driver()
        mobber_manager.switch_next_driver()
        mobber_manager.switch_next_driver()
        mobber_manager.switch_next_driver()
        mobber_manager.switch_next_driver()
        mobber_manager.remove_mobber(2)
        mobber_manager.remove_mobber(0)
        mobber_manager.switch_next_driver()
        mobber_manager.rewind_driver()
        mobber_manager.add_mobber("Seth")
        mobber_manager.rewind_driver()
        mobber_manager.rewind_driver()
        mobber_manager.rewind_driver()
        mobber_manager.move_mobber_down(0)
        mobber_manager.add_mobber("Fredrick")
        mobber_manager.move_mobber_up(2)
        mobber_manager.remove_mobber(1)
        mobber_manager.remove_mobber(0)
        mobber_manager.remove_mobber(0)

        Approvals.verify(result["result"], self.reporter)
开发者ID:MobProgramming,项目名称:MobTimer.Python,代码行数:48,代码来源:TestsMobberManager.py

示例3: test_move_up_empty

# 需要导入模块: from Infrastructure.MobberManager import MobberManager [as 别名]
# 或者: from Infrastructure.MobberManager.MobberManager import move_mobber_up [as 别名]
 def test_move_up_empty(self):
     mobber_manager = MobberManager()
     mobber_manager.move_mobber_up(0)
     result = []
     self.assertEqual(mobber_manager.get_mobbers(), result)
开发者ID:MobProgramming,项目名称:MobTimer.Python,代码行数:7,代码来源:TestsMobberManager.py


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