Help us understand the problem. What is going on with this article?

Travis CIでAPIをテストするときは

More than 1 year has passed since last update.

Travis CIでAPIをテストするときには、APIを使うテスト前に「APIが利用できるか」確認しましょう。

# Checks if API is available. This file is in the public domain.
import sys
import requests
api = requests.get("https://api.scratch.mit.edu").status_code
if api>=400:
    print("API not available! Test failed.")
    sys.exit(1)
print("API confirmed.")
sys.exit(0)
apple502j
Logo is by me, CC BY-SA 2.0
https://github.com/apple502j
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away