當前位置: 首頁>>代碼示例>>Python>>正文


Python MobberManager.remove_mobber方法代碼示例

本文整理匯總了Python中Infrastructure.MobberManager.MobberManager.remove_mobber方法的典型用法代碼示例。如果您正苦於以下問題:Python MobberManager.remove_mobber方法的具體用法?Python MobberManager.remove_mobber怎麽用?Python MobberManager.remove_mobber使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Infrastructure.MobberManager.MobberManager的用法示例。


在下文中一共展示了MobberManager.remove_mobber方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_add_mobber_joe_chris_joe__remove_joe_has_joe_chris

# 需要導入模塊: from Infrastructure.MobberManager import MobberManager [as 別名]
# 或者: from Infrastructure.MobberManager.MobberManager import remove_mobber [as 別名]
 def test_add_mobber_joe_chris_joe__remove_joe_has_joe_chris(self):
     mobber_manager = MobberManager()
     mobber_manager.add_mobber("Joe")
     mobber_manager.add_mobber("Chris")
     mobber_manager.add_mobber("John")
     mobber_manager.remove_mobber(2)
     result = ["Joe", "Chris"]
     self.assertEqual(mobber_manager.get_mobbers(), result)
開發者ID:MobProgramming,項目名稱:MobTimer.Python,代碼行數:10,代碼來源:TestsMobberManager.py

示例2: test_subscribe_to_mobber_list_changes

# 需要導入模塊: from Infrastructure.MobberManager import MobberManager [as 別名]
# 或者: from Infrastructure.MobberManager.MobberManager import remove_mobber [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_remove_empty

# 需要導入模塊: from Infrastructure.MobberManager import MobberManager [as 別名]
# 或者: from Infrastructure.MobberManager.MobberManager import remove_mobber [as 別名]
 def test_remove_empty(self):
     mobber_manager = MobberManager()
     mobber_manager.remove_mobber(0)
     result = []
     self.assertEqual(mobber_manager.get_mobbers(), result)
開發者ID:MobProgramming,項目名稱:MobTimer.Python,代碼行數:7,代碼來源:TestsMobberManager.py


注:本文中的Infrastructure.MobberManager.MobberManager.remove_mobber方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。