Beispiel #1
0
def test_GitHub_fetch_issues(m):
    g = GitHub('18f.gsa.gov', '18F')
    url = "%s/repos/%s/%s/issues?per_page=100" % (g.api, g.owner, g.repo)
    expected = [{"number": i} for i in range(100)]
    m.get(url,
          json=expected,
          status_code=200,
          headers={'Content-Type': 'application/json'})
    actual = g.fetch_issues()
    assert list(actual) == expected
Beispiel #2
0
def test_GitHub_fetch_issues(m):
    g = GitHub('18f.gsa.gov', '18F')
    url = "%s/repos/%s/%s/issues?per_page=100" % (g.api, g.owner, g.repo)
    expected = [{"number": i} for i in range(100)]
    m.get(url,
          json=expected,
          status_code=200,
          headers={'Content-Type': 'application/json'})
    actual = g.fetch_issues()
    assert list(actual) == expected
Beispiel #3
0
def test_GitHub_fetch_issues_request_not_ok(m):
    g = GitHub('18f.gsa.gov', '18F')
    url = "%s/repos/%s/%s/issues" % (g.api, g.owner, g.repo)
    m.get(url, text="I'm a teapot", status_code=418)
    actual = g.fetch_issues()
    assert actual == False
Beispiel #4
0
def test_GitHub_fetch_issues_request_not_ok(m):
    g = GitHub('18f.gsa.gov', '18F')
    url = "%s/repos/%s/%s/issues" % (g.api, g.owner, g.repo)
    m.get(url, text="I'm a teapot", status_code=418)
    actual = g.fetch_issues()
    assert actual == False