Skip to content

Commit

Permalink
Merge pull request #74 from Suban05/211_update_fake_octokit
Browse files Browse the repository at this point in the history
update `Fbe::FakeOctokit`
  • Loading branch information
yegor256 authored Aug 17, 2024
2 parents 62a388f + ea4082a commit 1ccc2cf
Showing 1 changed file with 200 additions and 0 deletions.
200 changes: 200 additions & 0 deletions lib/fbe/octo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,206 @@ def repository_events(repo, _options = {})
},
created_at: random_time,
public: true
},
{
id: 42,
created_at: Time.now,
actor: { id: 42 },
type: 'PullRequestEvent',
repo: { id: repo },
payload: {
action: 'closed',
number: 172,
ref_type: 'tag',
ref: 'foo',
pull_request: {
url: 'https://api.github.com/repos/yegor256/judges/pulls/93',
id: 1_990_323_142,
node_id: 'PR_kwDOL6GCO852oevG',
number: 172,
state: 'closed',
locked: false,
title: '#999 new feature',
user: {
login: 'test',
id: 88_084_038,
node_id: 'MDQ6VXNlcjE2NDYwMjA=',
type: 'User',
site_admin: false
},
base: {
label: 'zerocracy:master',
ref: 'master',
user: {
login: 'zerocracy',
id: 24_234_201
},
repo: {
id: repo,
node_id: 'R_kgDOK2_4Aw',
name: 'baza',
full_name: 'zerocracy/baza',
private: false
}
},
head: {
ref: 'zerocracy/baza'
},
merged_at: Time.now,
comments: 2,
review_comments: 2,
commits: 1,
additions: 3,
deletions: 3,
changed_files: 2
}
}
}
]
end

def pull_request_comments(_name, _number)
[
{
pull_request_review_id: 2_227_372_510,
id: 1_709_082_318,
path: 'test/baza/test_locks.rb',
commit_id: 'a9f5f94cf28f29a64d5dd96d0ee23b4174572847',
original_commit_id: 'e8c6f94274d14ed3cb26fe71467a9c3f229df59c',
user: {
login: 'Reviewer',
id: 2_566_462
},
body: 'Most likely, parentheses were missed here.',
created_at: '2024-08-08T09:41:46Z',
updated_at: '2024-08-08T09:42:46Z',
reactions: {
url: 'https://api.github.com/repos/zerocracy/baza/pulls/comments/1709082318/reactions',
total_count: 0
},
start_line: 'null',
original_start_line: 'null',
start_side: 'null',
line: 'null',
original_line: 62,
side: 'RIGHT',
original_position: 25,
position: 'null',
subject_type: 'line'
},
{
pull_request_review_id: 2_227_372_510,
id: 1_709_082_319,
path: 'test/baza/test_locks.rb',
commit_id: 'a9f5f94cf28f29a64d5dd96d0ee23b4174572847',
original_commit_id: 'e8c6f94274d14ed3cb26fe71467a9c3f229df59c',
user: {
login: 'test',
id: 88_084_038
},
body: 'definitely a typo',
created_at: '2024-08-08T09:42:46Z',
updated_at: '2024-08-08T09:42:46Z',
reactions: {
url: 'https://api.github.com/repos/zerocracy/baza/pulls/comments/1709082319/reactions',
total_count: 0
},
start_line: 'null',
original_start_line: 'null',
start_side: 'null',
line: 'null',
original_line: 62,
side: 'RIGHT',
original_position: 25,
in_reply_to_id: 1_709_082_318,
position: 'null',
subject_type: 'line'
}
]
end

def issue_comments(_name, _number)
[
{
pull_request_review_id: 2_227_372_510,
id: 1_709_082_320,
path: 'test/baza/test_locks.rb',
commit_id: 'a9f5f94cf28f29a64d5dd96d0ee23b4174572847',
original_commit_id: 'e8c6f94274d14ed3cb26fe71467a9c3f229df59c',
user: {
login: 'Reviewer',
id: 2_566_462
},
body: 'reviewer comment',
created_at: '2024-08-08T09:41:46Z',
updated_at: '2024-08-08T09:42:46Z',
reactions: {
url: 'https://api.github.com/repos/zerocracy/baza/pulls/comments/1709082320/reactions',
total_count: 1
},
start_line: 'null',
original_start_line: 'null',
start_side: 'null',
line: 'null',
original_line: 62,
side: 'RIGHT',
original_position: 25,
position: 'null',
subject_type: 'line'
},
{
pull_request_review_id: 2_227_372_510,
id: 1_709_082_321,
path: 'test/baza/test_locks.rb',
commit_id: 'a9f5f94cf28f29a64d5dd96d0ee23b4174572847',
original_commit_id: 'e8c6f94274d14ed3cb26fe71467a9c3f229df59c',
user: {
login: 'test',
id: 88_084_038
},
body: 'author comment',
created_at: '2024-08-08T09:42:46Z',
updated_at: '2024-08-08T09:42:46Z',
reactions: {
url: 'https://api.github.com/repos/zerocracy/baza/pulls/comments/1709082321/reactions',
total_count: 1
},
start_line: 'null',
original_start_line: 'null',
start_side: 'null',
line: 'null',
original_line: 62,
side: 'RIGHT',
original_position: 25,
in_reply_to_id: 1_709_082_318,
position: 'null',
subject_type: 'line'
}
]
end

def issue_comment_reactions(_name, _comment)
[
{
id: 248_923_574,
user: {
login: 'user',
id: 8_086_956
},
content: 'heart'
}
]
end

def pull_request_review_comment_reactions(_name, _comment)
[
{
id: 248_923_574,
user: {
login: 'user',
id: 8_086_956
},
content: 'heart'
}
]
end
Expand Down

0 comments on commit 1ccc2cf

Please sign in to comment.