| 1 |
""" |
| 2 |
Generated by generate/generate.py - 2020-08-02 10:29:03.550853 |
| 3 |
""" |
| 4 |
from aiogithubapi.objects.repos.branch import AIOGitHubAPIReposBranch |
| 5 |
|
| 6 |
from tests.legacy.responses.repos.branch_fixtrue import branch_fixtrue_response |
| 7 |
|
| 8 |
|
| 9 |
def test_branch(branch_fixtrue_response): |
| 10 |
obj = AIOGitHubAPIReposBranch(branch_fixtrue_response) |
| 11 |
assert obj.name == branch_fixtrue_response["name"] |
| 12 |
assert obj.commit.sha == branch_fixtrue_response["commit"]["sha"] |
| 13 |
assert obj.commit.node_id == branch_fixtrue_response["commit"]["node_id"] |
| 14 |
assert ( |
| 15 |
obj.commit.commit.author.name |
| 16 |
== branch_fixtrue_response["commit"]["commit"]["author"]["name"] |
| 17 |
) |
| 18 |
assert ( |
| 19 |
obj.commit.commit.author.date |
| 20 |
== branch_fixtrue_response["commit"]["commit"]["author"]["date"] |
| 21 |
) |
| 22 |
assert ( |
| 23 |
obj.commit.commit.author.email |
| 24 |
== branch_fixtrue_response["commit"]["commit"]["author"]["email"] |
| 25 |
) |
| 26 |
assert obj.commit.commit.url == branch_fixtrue_response["commit"]["commit"]["url"] |
| 27 |
assert obj.commit.commit.message == branch_fixtrue_response["commit"]["commit"]["message"] |
| 28 |
assert obj.commit.commit.tree.sha == branch_fixtrue_response["commit"]["commit"]["tree"]["sha"] |
| 29 |
assert obj.commit.commit.tree.url == branch_fixtrue_response["commit"]["commit"]["tree"]["url"] |
| 30 |
assert ( |
| 31 |
obj.commit.commit.committer.name |
| 32 |
== branch_fixtrue_response["commit"]["commit"]["committer"]["name"] |
| 33 |
) |
| 34 |
assert ( |
| 35 |
obj.commit.commit.committer.date |
| 36 |
== branch_fixtrue_response["commit"]["commit"]["committer"]["date"] |
| 37 |
) |
| 38 |
assert ( |
| 39 |
obj.commit.commit.committer.email |
| 40 |
== branch_fixtrue_response["commit"]["commit"]["committer"]["email"] |
| 41 |
) |
| 42 |
assert ( |
| 43 |
obj.commit.commit.verification.verified |
| 44 |
== branch_fixtrue_response["commit"]["commit"]["verification"]["verified"] |
| 45 |
) |
| 46 |
assert ( |
| 47 |
obj.commit.commit.verification.reason |
| 48 |
== branch_fixtrue_response["commit"]["commit"]["verification"]["reason"] |
| 49 |
) |
| 50 |
assert ( |
| 51 |
obj.commit.commit.verification.signature |
| 52 |
== branch_fixtrue_response["commit"]["commit"]["verification"]["signature"] |
| 53 |
) |
| 54 |
assert ( |
| 55 |
obj.commit.commit.verification.payload |
| 56 |
== branch_fixtrue_response["commit"]["commit"]["verification"]["payload"] |
| 57 |
) |
| 58 |
assert ( |
| 59 |
obj.commit.author.gravatar_id == branch_fixtrue_response["commit"]["author"]["gravatar_id"] |
| 60 |
) |
| 61 |
assert obj.commit.author.avatar_url == branch_fixtrue_response["commit"]["author"]["avatar_url"] |
| 62 |
assert obj.commit.author.url == branch_fixtrue_response["commit"]["author"]["url"] |
| 63 |
assert obj.commit.author.id == branch_fixtrue_response["commit"]["author"]["id"] |
| 64 |
assert obj.commit.author.login == branch_fixtrue_response["commit"]["author"]["login"] |
| 65 |
assert obj.commit.parents[0].sha == branch_fixtrue_response["commit"]["parents"][0]["sha"] |
| 66 |
assert obj.commit.parents[0].url == branch_fixtrue_response["commit"]["parents"][0]["url"] |
| 67 |
assert obj.commit.url == branch_fixtrue_response["commit"]["url"] |
| 68 |
assert ( |
| 69 |
obj.commit.committer.gravatar_id |
| 70 |
== branch_fixtrue_response["commit"]["committer"]["gravatar_id"] |
| 71 |
) |
| 72 |
assert ( |
| 73 |
obj.commit.committer.avatar_url |
| 74 |
== branch_fixtrue_response["commit"]["committer"]["avatar_url"] |
| 75 |
) |
| 76 |
assert obj.commit.committer.url == branch_fixtrue_response["commit"]["committer"]["url"] |
| 77 |
assert obj.commit.committer.id == branch_fixtrue_response["commit"]["committer"]["id"] |
| 78 |
assert obj.commit.committer.login == branch_fixtrue_response["commit"]["committer"]["login"] |
| 79 |
assert obj.protected == branch_fixtrue_response["protected"] |
| 80 |
assert obj.protection.enabled == branch_fixtrue_response["protection"]["enabled"] |
| 81 |
assert ( |
| 82 |
obj.protection.required_status_checks.enforcement_level |
| 83 |
== branch_fixtrue_response["protection"]["required_status_checks"]["enforcement_level"] |
| 84 |
) |
| 85 |
assert ( |
| 86 |
obj.protection.required_status_checks.contexts[0] |
| 87 |
== branch_fixtrue_response["protection"]["required_status_checks"]["contexts"][0] |
| 88 |
) |
| 89 |
assert obj.protection_url == branch_fixtrue_response["protection_url"] |