本文整理汇总了Python中rogerthat.bizz.friend_helper.FriendHelper.serialize方法的典型用法代码示例。如果您正苦于以下问题:Python FriendHelper.serialize方法的具体用法?Python FriendHelper.serialize怎么用?Python FriendHelper.serialize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rogerthat.bizz.friend_helper.FriendHelper
的用法示例。
在下文中一共展示了FriendHelper.serialize方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_cs_helper_for_user
# 需要导入模块: from rogerthat.bizz.friend_helper import FriendHelper [as 别名]
# 或者: from rogerthat.bizz.friend_helper.FriendHelper import serialize [as 别名]
def test_cs_helper_for_user(self):
helper = FriendHelper.serialize(self.john, FriendTO.TYPE_USER)
self.assertIsInstance(helper.get_profile_info(), UserProfile)
self.assertIsNone(helper.get_service_profile())
self.assertIsNone(helper.get_share_sid())
self.assertIsNone(helper.get_translator())
self.assertIsNone(helper.get_service_data())
self.assertListEqual(helper.list_service_menu_items(), [])
示例2: _serialize_and_update_friend_for_service_identity
# 需要导入模块: from rogerthat.bizz.friend_helper import FriendHelper [as 别名]
# 或者: from rogerthat.bizz.friend_helper.FriendHelper import serialize [as 别名]
def _serialize_and_update_friend_for_service_identity(service_identity_user, clear_broadcast_settings_cache,
get_fsics_query_function, get_fsics_query_function_args,
worker_queue=HIGH_LOAD_WORKER_QUEUE):
helper = FriendHelper.serialize(service_identity_user, FRIEND_TYPE_SERVICE)
run_job(get_fsics_query_function, get_fsics_query_function_args, _update_friend_via_friend_connection,
[helper, clear_broadcast_settings_cache],
worker_queue=worker_queue)
示例3: trans
# 需要导入模块: from rogerthat.bizz.friend_helper import FriendHelper [as 别名]
# 或者: from rogerthat.bizz.friend_helper.FriendHelper import serialize [as 别名]
def trans(user):
helper = FriendHelper.serialize(user, friend_type)
if friend_type == FRIEND_TYPE_SERVICE:
user = remove_slash_default(user)
else:
update_friend_service_identity_connections(UserProfile.createKey(user), changed_properties)
run_job(get_friends_friends_maps_keys_query, [user], _update_friend, [helper, clear_broadcast_settings_cache],
worker_queue=worker_queue)
示例4: test_friend_to
# 需要导入模块: from rogerthat.bizz.friend_helper import FriendHelper [as 别名]
# 或者: from rogerthat.bizz.friend_helper.FriendHelper import serialize [as 别名]
def test_friend_to(self):
self._extend_service()
app_user = users.User(u'[email protected]')
create_user_profile(app_user, u"John Doe")
makeFriends(app_user, self.service_user, self.service_user, None, ORIGIN_USER_INVITE)
cs_helper = FriendHelper.serialize(self.service_identity_user, FriendTO.TYPE_SERVICE)
ds_helper = FriendHelper.from_data_store(self.service_user, FriendTO.TYPE_SERVICE)
friend_map = get_friends_map(app_user)
friend_detail = friend_map.friendDetails[self.service_user.email()]
status = UpdateFriendRequestTO.STATUS_MODIFIED
ds_friend = convert_friend(ds_helper, app_user, friend_detail, status)
cs_friend = convert_friend(cs_helper, app_user, friend_detail, status)
self.assertDictEqual(ds_friend.to_dict(), cs_friend.to_dict())
示例5: connect_auto_connected_service
# 需要导入模块: from rogerthat.bizz.friend_helper import FriendHelper [as 别名]
# 或者: from rogerthat.bizz.friend_helper.FriendHelper import serialize [as 别名]
def connect_auto_connected_service(app_id, acs):
# type: (unicode, AutoConnectedService) -> None
helper = FriendHelper.serialize(users.User(acs.service_identity_email), FRIEND_TYPE_SERVICE)
run_job(get_user_profile_keys_by_app_id, [app_id],
hookup_with_default_services.run_for_auto_connected_service, [acs, None, helper])
示例6: test_cs_helper_for_complex_service
# 需要导入模块: from rogerthat.bizz.friend_helper import FriendHelper [as 别名]
# 或者: from rogerthat.bizz.friend_helper.FriendHelper import serialize [as 别名]
def test_cs_helper_for_complex_service(self):
self._extend_service()
helper = FriendHelper.serialize(self.service_identity_user, FriendTO.TYPE_SERVICE)
self._assert_complex_service(helper)
示例7: test_cs_helper_for_simple_service
# 需要导入模块: from rogerthat.bizz.friend_helper import FriendHelper [as 别名]
# 或者: from rogerthat.bizz.friend_helper.FriendHelper import serialize [as 别名]
def test_cs_helper_for_simple_service(self):
helper = FriendHelper.serialize(self.service_identity_user, FriendTO.TYPE_SERVICE)
self._assert_simple_service(helper)