forked from forgejo/forgejo
Unit tests for models/pull.go
This commit is contained in:
parent
1a7fc53c98
commit
72bfabfada
8 changed files with 421 additions and 21 deletions
46
models/fixtures/issue.yml
Normal file
46
models/fixtures/issue.yml
Normal file
|
@ -0,0 +1,46 @@
|
|||
-
|
||||
id: 1
|
||||
repo_id: 1
|
||||
index: 1
|
||||
poster_id: 1
|
||||
name: issue1
|
||||
content: content1
|
||||
is_closed: false
|
||||
is_pull: false
|
||||
created_unix: 946684800
|
||||
updated_unix: 978307200
|
||||
|
||||
-
|
||||
id: 2
|
||||
repo_id: 1
|
||||
index: 2
|
||||
poster_id: 1
|
||||
name: issue2
|
||||
content: content2
|
||||
is_closed: false
|
||||
is_pull: true
|
||||
created_unix: 946684810
|
||||
updated_unix: 978307190
|
||||
|
||||
|
||||
-
|
||||
id: 3
|
||||
repo_id: 1
|
||||
index: 3
|
||||
poster_id: 1
|
||||
name: issue3
|
||||
content: content4
|
||||
is_closed: false
|
||||
is_pull: true
|
||||
created_unix: 946684820
|
||||
updated_unix: 978307180
|
||||
|
||||
-
|
||||
id: 4
|
||||
repo_id: 2
|
||||
index: 1
|
||||
poster_id: 2
|
||||
name: issue4
|
||||
content: content4
|
||||
is_closed: true
|
||||
is_pull: false
|
28
models/fixtures/pull_request.yml
Normal file
28
models/fixtures/pull_request.yml
Normal file
|
@ -0,0 +1,28 @@
|
|||
-
|
||||
id: 1
|
||||
type: 0 # gitea pull request
|
||||
status: 2 # mergable
|
||||
issue_id: 2
|
||||
index: 1
|
||||
head_repo_id: 1
|
||||
base_repo_id: 1
|
||||
head_user_name: user1
|
||||
head_branch: branch1
|
||||
base_branch: master
|
||||
merge_base: 1234567890abcdef
|
||||
has_merged: true
|
||||
merger_id: 2
|
||||
|
||||
-
|
||||
id: 2
|
||||
type: 0 # gitea pull request
|
||||
status: 1 # checking
|
||||
issue_id: 3
|
||||
index: 2
|
||||
head_repo_id: 1
|
||||
base_repo_id: 1
|
||||
head_user_name: user1
|
||||
head_branch: branch2
|
||||
base_branch: master
|
||||
merge_base: fedcba9876543210
|
||||
has_merged: false
|
21
models/fixtures/repository.yml
Normal file
21
models/fixtures/repository.yml
Normal file
|
@ -0,0 +1,21 @@
|
|||
-
|
||||
id: 1
|
||||
owner_id: 2
|
||||
lower_name: repo1
|
||||
name: repo1
|
||||
is_private: false
|
||||
num_issues: 1
|
||||
num_closed_issues: 0
|
||||
num_pulls: 2
|
||||
num_closed_pulls: 0
|
||||
|
||||
-
|
||||
id: 2
|
||||
owner_id: 2
|
||||
lower_name: repo2
|
||||
name: repo2
|
||||
is_private: true
|
||||
num_issues: 1
|
||||
num_closed_issues: 1
|
||||
num_pulls: 0
|
||||
num_closed_pulls: 0
|
25
models/fixtures/user.yml
Normal file
25
models/fixtures/user.yml
Normal file
|
@ -0,0 +1,25 @@
|
|||
- # NOTE: this user (id=1) is the admin
|
||||
id: 1
|
||||
lower_name: user1
|
||||
name: user1
|
||||
email: user1@example.com
|
||||
passwd: password
|
||||
type: 0 # individual
|
||||
salt: salt
|
||||
is_admin: true
|
||||
avatar: avatar1
|
||||
avatar_email: user2@example.com
|
||||
num_repos: 0
|
||||
|
||||
-
|
||||
id: 2
|
||||
lower_name: user2
|
||||
name: user2
|
||||
email: user2@example.com
|
||||
passwd: password
|
||||
type: 0 # individual
|
||||
salt: salt
|
||||
is_admin: false
|
||||
avatar: avatar2
|
||||
avatar_email: user2@example.com
|
||||
num_repos: 2
|
Loading…
Add table
Add a link
Reference in a new issue