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


Python LogicStorage.bundles_to_accounts[777]方法代码示例

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


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

示例1: test_save_bundle_data

# 需要导入模块: from the_tale.game.logic_storage import LogicStorage [as 别名]
# 或者: from the_tale.game.logic_storage.LogicStorage import bundles_to_accounts[777] [as 别名]
    def test_save_bundle_data(self):

        storage = LogicStorage()

        storage.bundles_to_accounts[555] = set([1, 2])
        storage.bundles_to_accounts[666] = set([3, 7, 9])
        storage.bundles_to_accounts[777] = set([4, 5])

        storage.accounts_to_heroes = {1: mock.Mock(id=1),
                                      2: mock.Mock(id=2),
                                      3: mock.Mock(id=3),
                                      4: mock.Mock(id=4),
                                      5: mock.Mock(id=5),
                                      7: mock.Mock(id=7),
                                      9: mock.Mock(id=9)}

        with mock.patch('the_tale.game.logic_storage.LogicStorage._save_hero_data') as _save_hero_data:
            with mock.patch('the_tale.game.logic_storage.LogicStorage.process_cache_queue') as process_cache_queue:
                storage.save_bundle_data(666)

        self.assertEqual(_save_hero_data.call_count, 3)
        self.assertEqual(storage.cache_queue, set([3, 7, 9]))
        self.assertEqual(process_cache_queue.call_count, 1)

        self.assertEqual(set(call[0][0] for call in _save_hero_data.call_args_list), set([3, 7, 9]))
开发者ID:alexudracul,项目名称:the-tale,代码行数:27,代码来源:test_logic_storage.py

示例2: test_unmerge_bundles__last_account_in_bundle

# 需要导入模块: from the_tale.game.logic_storage import LogicStorage [as 别名]
# 或者: from the_tale.game.logic_storage.LogicStorage import bundles_to_accounts[777] [as 别名]
    def test_unmerge_bundles__last_account_in_bundle(self):
        storage = LogicStorage()

        storage.bundles_to_accounts[555] = set([1, 2])
        storage.bundles_to_accounts[666] = set([3])
        storage.bundles_to_accounts[777] = set([4, 5])

        storage.unmerge_bundles(3, 666, 555)

        self.assertEqual(storage.bundles_to_accounts, {555: set([1, 2, 3]),
                                                       777: set([4, 5])})
开发者ID:alexudracul,项目名称:the-tale,代码行数:13,代码来源:test_logic_storage.py

示例3: test_merge_bundles__in_existed_bundle

# 需要导入模块: from the_tale.game.logic_storage import LogicStorage [as 别名]
# 或者: from the_tale.game.logic_storage.LogicStorage import bundles_to_accounts[777] [as 别名]
    def test_merge_bundles__in_existed_bundle(self):

        storage = LogicStorage()

        storage.bundles_to_accounts[555] = set([1, 2])
        storage.bundles_to_accounts[666] = set([3])
        storage.bundles_to_accounts[777] = set([4, 5])

        storage.merge_bundles([555, 666], 777)

        self.assertEqual(storage.bundles_to_accounts, {777: set([1, 2, 3, 4, 5])})
开发者ID:alexudracul,项目名称:the-tale,代码行数:13,代码来源:test_logic_storage.py

示例4: test_unmerge_bundles__in_existed_bundle

# 需要导入模块: from the_tale.game.logic_storage import LogicStorage [as 别名]
# 或者: from the_tale.game.logic_storage.LogicStorage import bundles_to_accounts[777] [as 别名]
    def test_unmerge_bundles__in_existed_bundle(self):
        storage = LogicStorage()

        storage.bundles_to_accounts[555] = set([1, 2])
        storage.bundles_to_accounts[666] = set([3])
        storage.bundles_to_accounts[777] = set([4, 5])

        storage.unmerge_bundles(4, 777, 666)

        self.assertEqual(storage.bundles_to_accounts, {555: set([1, 2]),
                                                       666: set([3, 4]),
                                                       777: set([5])})
开发者ID:alexudracul,项目名称:the-tale,代码行数:14,代码来源:test_logic_storage.py


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