map["/repos/nitlang/nit/pulls?page=1&per_page=3"] = "repo_pulls_nit"
map["/repos/nitlang/nit/pulls/1000"] = "repo_pulls_1000"
map["/repos/nitlang/nit/commits/64ce1f"] = "repo_commits_64ce1f"
+ map["/repos/nitlang/nit/commits/4e3c688d/status"] = "repo_commits_4e3c68_status"
map["/repos/nitlang/nit/comments/8982707"] = "repo_comments_8982707"
map["/repos/nitlang/nit/pulls/comments/21010363"] = "repo_pulls_comment_21010363"
map["/search/issues?q=foo repo:nitlang/nit&page=1&per_page=3"] = "repo_search_issues_nit"
# TODO other fields
end
+ fun test_get_commit_status is test do
+ var status = api.get_commit_status("nitlang/nit", "4e3c688d")
+ assert status isa CommitStatus
+ assert status.state == "failure"
+ assert status.sha == "4e3c688d2c4b875c00f206eb4c4b6f2c4f34c096"
+ assert status.total_count == 1
+
+ var sub = status.statuses.first
+ assert sub.state == "failure"
+ assert sub.description == "Merged pipeline on gitlab: failed"
+ assert sub.context == "gitlab-ci"
+
+ var repo = status.repository
+ assert repo isa Repo
+ assert repo.full_name == "nitlang/nit"
+ end
+
fun test_get_issue is test do
var issue = api.get_issue("nitlang/nit", 1000)
assert issue isa Issue
assert pull.body == "Raise dead on `nitc`.\nIt's super effective...\n"
end
+ fun test_get_pull_comment is test do
+ var comment = api.get_pull_comment("nitlang/nit", 21010363)
+ assert comment isa ReviewComment
+ assert comment.path == "src/modelize/modelize_property.nit"
+ assert comment.original_position == 26
+ assert comment.pull_number == 945
+ # TODO other fields
+ end
+
fun test_get_label is test do
var labl = api.get_label("nitlang/nit", "ok_will_merge")
assert labl isa Label
assert comment.body == "For testing purposes...\n"
assert comment.commit_id == "7eacb86d1e24b7e72bc9ac869bf7182c0300ceca"
end
-
- fun test_get_review_comments is test do
- var comment = api.get_review_comment("nitlang/nit", 21010363)
- assert comment isa ReviewComment
- assert comment.path == "src/modelize/modelize_property.nit"
- assert comment.original_position == 26
- assert comment.pull_number == 945
- end
end