-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_client.py
More file actions
30 lines (24 loc) · 781 Bytes
/
test_client.py
File metadata and controls
30 lines (24 loc) · 781 Bytes
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
import os
from datetime import datetime
from client import GithubClient
def test_client() -> None:
TEST_OWNER = "bendevera"
TEST_REPO = "test-repo"
GITHUB_TOKEN = str(os.getenv("GITHUB_TOKEN"))
client = GithubClient(GITHUB_TOKEN, TEST_OWNER, TEST_REPO)
pull_requests = client.list_pull_requests()
assert len(pull_requests) == 0
success, pull_request = client.create_pull(
"Test Pull",
"test-branch-2",
"master")
assert success
is_merged = client.is_merged(pull_request["number"])
assert not is_merged
success, pull_request = client.update_pull(
pull_request["number"],
{
"state": "closed",
"body": "test completed %s" % (datetime.now())
})
assert success