-
Notifications
You must be signed in to change notification settings - Fork 380
Expand file tree
/
Copy pathtest_github_event.py
More file actions
43 lines (32 loc) · 1.86 KB
/
test_github_event.py
File metadata and controls
43 lines (32 loc) · 1.86 KB
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
import pytest
pytestmark = pytest.mark.github
def test_pull_request_review_submit_event(make_event_from_fixture):
event = make_event_from_fixture("tests/fixtures/github/pull_request_review_submit.json")
assert not event.is_pull_request
assert event.is_review
assert event.pull_request_url == "https://api.github.com/repos/Codertocat/Hello-World/pulls/2"
def test_pull_request_synchronized_event(make_event_from_fixture):
event = make_event_from_fixture("tests/fixtures/github/pull_request_synchronized.json")
assert event.is_pull_request
assert event.pull_request_url == "https://api.github.com/repos/Codertocat/Hello-World/pulls/2"
def test_github_pull_request_comment(make_event_from_fixture):
event = make_event_from_fixture("tests/fixtures/github/pull_request_comment.json")
assert event.is_comment
assert event.pull_request_url == "https://api.github.com/repos/Codertocat/Hello-World/pulls/2"
assert event.pull_request_comment_body == "example_comment"
def test_pull_request_synchronized_info(make_event_from_fixture, make_pull_request_info):
pull_request_info = make_pull_request_info(
make_event_from_fixture("tests/fixtures/github/pull_request_synchronized.json")
)
assert pull_request_info.owner == "Codertocat"
assert pull_request_info.repo == "Hello-World"
assert pull_request_info.pr_number == 2
assert pull_request_info.full_repo_path == "Codertocat/Hello-World"
def test_pull_request_synchronized_enterprise(make_event_from_fixture, make_pull_request_info):
pull_request_info = make_pull_request_info(
make_event_from_fixture("tests/fixtures/github/pull_request_synchronized_enterprise.json")
)
assert pull_request_info.owner == "org"
assert pull_request_info.repo == "repo"
assert pull_request_info.pr_number == 3
assert pull_request_info.full_repo_path == "org/repo"