def test_submit_problem_web(self):
common.ensure_login()
common.ensure_api_key()
# publish_time is before the first publish time
with self.assertRaises(requests.HTTPError) as cm:
self.submit_problem_web(1475279990, 1451606400)
assert cm.exception.response.status_code == 403
# Correct publish_time
self.submit_problem_web(1475280000, 1451606400)
self.submit_problem_web(1480550400, 1451606400)
# publish_time is after the last publish time
with self.assertRaises(requests.HTTPError) as cm:
self.submit_problem_web(1480550410, 1451606400)
assert cm.exception.response.status_code == 403
# publish_time is past
with self.assertRaises(requests.HTTPError) as cm:
self.submit_problem_web(1475280000, 1475280001)
assert cm.exception.response.status_code == 403
评论列表
文章目录