本文整理汇总了Python中vilya.models.user.User.add_participated_pull_request方法的典型用法代码示例。如果您正苦于以下问题:Python User.add_participated_pull_request方法的具体用法?Python User.add_participated_pull_request怎么用?Python User.add_participated_pull_request使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vilya.models.user.User
的用法示例。
在下文中一共展示了User.add_participated_pull_request方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: add_participant
# 需要导入模块: from vilya.models.user import User [as 别名]
# 或者: from vilya.models.user.User import add_participated_pull_request [as 别名]
def add_participant(self, username):
participants = self.participants
if username and username not in participants:
participants.append(username)
self.set_props_item('participants', participants)
user = User(username)
user.add_participated_pull_request(self.id)
return self.participants
示例2: test_get_user_pull_requests
# 需要导入模块: from vilya.models.user import User [as 别名]
# 或者: from vilya.models.user.User import add_participated_pull_request [as 别名]
def test_get_user_pull_requests(self):
u = User('testu%s' % time.time())
title = 'test title'
desc = 'test desc'
t1 = Ticket.add(self.proj1.id, title, desc, u.username)
assert u.get_invited_pull_requests() == []
u.add_invited_pull_request(t1.id)
print u.get_invited_pull_requests()
assert u.get_invited_pull_requests()[0].id == t1.id
assert u.n_open_invited == 1
assert u.get_participated_pull_requests()[0].id == t1.id
u.add_participated_pull_request(t1.id)
assert u.get_participated_pull_requests()[0].id == t1.id
assert u.n_open_participated == 1