本文整理汇总了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]))
示例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])})
示例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])})
示例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])})