-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_contributor_routes.py
69 lines (56 loc) · 2.35 KB
/
test_contributor_routes.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
import requests
import pytest
@pytest.fixture(scope="session")
def metrics():
pass
def test_contributors_by_group(metrics):
response = requests.get('http://localhost:5000/api/unstable/repo-groups/20/contributors')
data = response.json()
assert response.status_code == 200
assert len(data) >= 1
assert data[0]["total"] > 0
def test_contributors_by_repo(metrics):
response = requests.get('http://localhost:5000/api/unstable/repo-groups/20/repos/21000/contributors')
data = response.json()
assert response.status_code == 200
assert len(data) >= 1
assert data[0]["total"] > 0
def test_contributors_new_by_group(metrics):
response = requests.get('http://localhost:5000/api/unstable/repo-groups/24/contributors-new')
data = response.json()
assert response.status_code == 200
assert len(data) >= 1
assert data[0]["count"] > 0
def test_contributors_new_by_repo(metrics):
response = requests.get('http://localhost:5000/api/unstable/repo-groups/20/repos/21070/contributors-new')
data = response.json()
assert response.status_code == 200
assert len(data) >= 1
assert data[0]["count"] > 0
def test_top_committers_by_repo(metrics):
response = requests.get('http://0.0.0.0:5000/api/unstable/repo-groups/22/repos/21334/top-committers')
data = response.json()
assert response.status_code == 200
assert len(data) >= 1
assert data[0]['commits'] > 0
def test_top_committers_by_group(metrics):
response = requests.get('http://0.0.0.0:5000/api/unstable/repo-groups/22/top-committers')
data = response.json()
assert response.status_code == 200
assert len(data) >= 1
assert data[0]['commits'] > 0
def test_committer_by_repo(metrics):
response = requests.get('http://localhost:5000/api/unstable/repo-groups/21/repos/21222/committers')
data = response.json()
assert response.status_code == 200
assert len(data) >= 1
def test_committer_by_group(metrics):
response = requests.get('http://localhost:5000/api/unstable/repo-groups/21/committers?period=year')
data = response.json()
assert response.status_code == 200
assert len(data) >= 1
def test_contributors(metrics):
response = request.get('http://localhost:5000/api/unstable/contributors/s@goggins.com/contributions')
data = response.json()
assert response.status_code == 200
assert len(data) >= 1