예제 #1
0
def test_GitHub_fetch_endpoint_when_request_not_ok(m):
    g = GitHub('18f.gsa.gov', '18F')
    endpoint = "nonexistentendpoint"
    url = "%s/repos/%s/%s/%s" % (g.api, g.owner, g.repo, endpoint)
    m.get(url, text="", status_code=404, headers={'Content-Type': 'text/html'})
    actual = g.fetch_endpoint(endpoint)
    assert actual is False
예제 #2
0
파일: test.py 프로젝트: 18F/site-data
def test_GitHub_fetch_endpoint_when_request_not_ok(m):
    g = GitHub('18f.gsa.gov', '18F')
    endpoint = "nonexistentendpoint"
    url = "%s/repos/%s/%s/%s" % (g.api, g.owner, g.repo, endpoint)
    m.get(url,
          text="",
          status_code=404,
          headers={'Content-Type': 'text/html'})
    actual = g.fetch_endpoint(endpoint)
    assert actual is False