我有这段代码,简化了:
def get_my_events(access_token):
get_events_url = graph_endpoint.format('/me/events')
# Create JSON payload
data ={
"subject": "Let's go for lunch",
"body": {
"contentType": "HTML",
"content": "Does late morning work for you?"
},
"start": {
"dateTime": "2018-10-15T12:00:00",
"timeZone": "Pacific Standard Time"
},
"end": {
"dateTime": "2018-010-16T14:00:00",
"timeZone": "Pacific Standard Time"
},
"location":{
"displayName":"Harry's Bar"
},
"attendees": [
{
"emailAddress": {
"address":"samanthab@contoso.onmicrosoft.com",
"name": "Samantha Booth"
},
"type": "required"
}
]
}
r = make_api_call('POST', get_events_url, access_token, payload = data)
print(r)
return "{0}: {1}".format(r.status_code, r.text)
问题是:当我使用行号逐个运行这些测试时,它们都完美无误地通过了。
当我一起运行它们时,第一个通过,第二个失败:它们返回404表示“投入”
怎么可能?没有通过“ url1”删除或创建的任何内容,仅更新了一个布尔值。