Set is_empty in fixtures (#18869)
This commit is contained in:
parent
33e19c8004
commit
5b0cdd6155
5 changed files with 43 additions and 6 deletions
|
@ -0,0 +1 @@
|
||||||
|
ref: refs/heads/main
|
|
@ -0,0 +1,6 @@
|
||||||
|
[core]
|
||||||
|
bare = true
|
||||||
|
repositoryformatversion = 0
|
||||||
|
filemode = false
|
||||||
|
symlinks = false
|
||||||
|
ignorecase = true
|
|
@ -24,6 +24,7 @@
|
||||||
owner_name: user2
|
owner_name: user2
|
||||||
lower_name: repo2
|
lower_name: repo2
|
||||||
name: repo2
|
name: repo2
|
||||||
|
is_empty: false
|
||||||
is_archived: false
|
is_archived: false
|
||||||
is_private: true
|
is_private: true
|
||||||
num_issues: 2
|
num_issues: 2
|
||||||
|
@ -40,6 +41,7 @@
|
||||||
owner_name: user3
|
owner_name: user3
|
||||||
lower_name: repo3
|
lower_name: repo3
|
||||||
name: repo3
|
name: repo3
|
||||||
|
is_empty: false
|
||||||
is_private: true
|
is_private: true
|
||||||
num_issues: 1
|
num_issues: 1
|
||||||
num_closed_issues: 0
|
num_closed_issues: 0
|
||||||
|
@ -56,6 +58,7 @@
|
||||||
owner_name: user5
|
owner_name: user5
|
||||||
lower_name: repo4
|
lower_name: repo4
|
||||||
name: repo4
|
name: repo4
|
||||||
|
is_empty: false
|
||||||
is_private: false
|
is_private: false
|
||||||
num_issues: 0
|
num_issues: 0
|
||||||
num_closed_issues: 0
|
num_closed_issues: 0
|
||||||
|
@ -143,6 +146,7 @@
|
||||||
owner_name: user12
|
owner_name: user12
|
||||||
lower_name: repo10
|
lower_name: repo10
|
||||||
name: repo10
|
name: repo10
|
||||||
|
is_empty: false
|
||||||
is_private: false
|
is_private: false
|
||||||
num_issues: 0
|
num_issues: 0
|
||||||
num_closed_issues: 0
|
num_closed_issues: 0
|
||||||
|
@ -160,6 +164,7 @@
|
||||||
owner_name: user13
|
owner_name: user13
|
||||||
lower_name: repo11
|
lower_name: repo11
|
||||||
name: repo11
|
name: repo11
|
||||||
|
is_empty: false
|
||||||
is_private: false
|
is_private: false
|
||||||
num_issues: 0
|
num_issues: 0
|
||||||
num_closed_issues: 0
|
num_closed_issues: 0
|
||||||
|
@ -217,7 +222,7 @@
|
||||||
owner_name: user2
|
owner_name: user2
|
||||||
lower_name: repo15
|
lower_name: repo15
|
||||||
name: repo15
|
name: repo15
|
||||||
is_empty: true
|
is_empty: false
|
||||||
is_private: true
|
is_private: true
|
||||||
status: 0
|
status: 0
|
||||||
|
|
||||||
|
@ -227,6 +232,7 @@
|
||||||
owner_name: user2
|
owner_name: user2
|
||||||
lower_name: repo16
|
lower_name: repo16
|
||||||
name: repo16
|
name: repo16
|
||||||
|
is_empty: false
|
||||||
is_private: true
|
is_private: true
|
||||||
num_issues: 0
|
num_issues: 0
|
||||||
num_closed_issues: 0
|
num_closed_issues: 0
|
||||||
|
@ -460,6 +466,7 @@
|
||||||
owner_name: user2
|
owner_name: user2
|
||||||
lower_name: repo20
|
lower_name: repo20
|
||||||
name: repo20
|
name: repo20
|
||||||
|
is_empty: false
|
||||||
is_private: true
|
is_private: true
|
||||||
num_stars: 0
|
num_stars: 0
|
||||||
num_forks: 0
|
num_forks: 0
|
||||||
|
@ -486,6 +493,7 @@
|
||||||
owner_name: user2
|
owner_name: user2
|
||||||
lower_name: utf8
|
lower_name: utf8
|
||||||
name: utf8
|
name: utf8
|
||||||
|
is_empty: false
|
||||||
is_private: false
|
is_private: false
|
||||||
status: 0
|
status: 0
|
||||||
|
|
||||||
|
@ -521,6 +529,7 @@
|
||||||
owner_name: user2
|
owner_name: user2
|
||||||
lower_name: commits_search_test
|
lower_name: commits_search_test
|
||||||
name: commits_search_test
|
name: commits_search_test
|
||||||
|
is_empty: false
|
||||||
is_private: false
|
is_private: false
|
||||||
num_stars: 0
|
num_stars: 0
|
||||||
num_forks: 0
|
num_forks: 0
|
||||||
|
@ -534,6 +543,7 @@
|
||||||
owner_name: user2
|
owner_name: user2
|
||||||
lower_name: git_hooks_test
|
lower_name: git_hooks_test
|
||||||
name: git_hooks_test
|
name: git_hooks_test
|
||||||
|
is_empty: false
|
||||||
is_private: false
|
is_private: false
|
||||||
num_stars: 0
|
num_stars: 0
|
||||||
num_forks: 0
|
num_forks: 0
|
||||||
|
@ -547,6 +557,7 @@
|
||||||
owner_name: limited_org
|
owner_name: limited_org
|
||||||
lower_name: public_repo_on_limited_org
|
lower_name: public_repo_on_limited_org
|
||||||
name: public_repo_on_limited_org
|
name: public_repo_on_limited_org
|
||||||
|
is_empty: false
|
||||||
is_private: false
|
is_private: false
|
||||||
num_stars: 0
|
num_stars: 0
|
||||||
num_forks: 0
|
num_forks: 0
|
||||||
|
@ -560,6 +571,7 @@
|
||||||
owner_name: limited_org
|
owner_name: limited_org
|
||||||
lower_name: private_repo_on_limited_org
|
lower_name: private_repo_on_limited_org
|
||||||
name: private_repo_on_limited_org
|
name: private_repo_on_limited_org
|
||||||
|
is_empty: false
|
||||||
is_private: true
|
is_private: true
|
||||||
num_stars: 0
|
num_stars: 0
|
||||||
num_forks: 0
|
num_forks: 0
|
||||||
|
@ -573,6 +585,7 @@
|
||||||
owner_name: privated_org
|
owner_name: privated_org
|
||||||
lower_name: public_repo_on_private_org
|
lower_name: public_repo_on_private_org
|
||||||
name: public_repo_on_private_org
|
name: public_repo_on_private_org
|
||||||
|
is_empty: false
|
||||||
is_private: false
|
is_private: false
|
||||||
num_stars: 0
|
num_stars: 0
|
||||||
num_forks: 0
|
num_forks: 0
|
||||||
|
@ -586,6 +599,7 @@
|
||||||
owner_name: privated_org
|
owner_name: privated_org
|
||||||
lower_name: private_repo_on_private_org
|
lower_name: private_repo_on_private_org
|
||||||
name: private_repo_on_private_org
|
name: private_repo_on_private_org
|
||||||
|
is_empty: false
|
||||||
is_private: true
|
is_private: true
|
||||||
num_stars: 0
|
num_stars: 0
|
||||||
num_forks: 0
|
num_forks: 0
|
||||||
|
@ -598,6 +612,7 @@
|
||||||
owner_name: user2
|
owner_name: user2
|
||||||
lower_name: glob
|
lower_name: glob
|
||||||
name: glob
|
name: glob
|
||||||
|
is_empty: false
|
||||||
is_private: false
|
is_private: false
|
||||||
num_stars: 0
|
num_stars: 0
|
||||||
num_forks: 0
|
num_forks: 0
|
||||||
|
@ -624,6 +639,7 @@
|
||||||
owner_name: user27
|
owner_name: user27
|
||||||
lower_name: template1
|
lower_name: template1
|
||||||
name: template1
|
name: template1
|
||||||
|
is_empty: false
|
||||||
is_private: false
|
is_private: false
|
||||||
is_template: true
|
is_template: true
|
||||||
num_stars: 0
|
num_stars: 0
|
||||||
|
@ -652,6 +668,7 @@
|
||||||
owner_name: org26
|
owner_name: org26
|
||||||
lower_name: repo_external_tracker
|
lower_name: repo_external_tracker
|
||||||
name: repo_external_tracker
|
name: repo_external_tracker
|
||||||
|
is_empty: false
|
||||||
is_private: false
|
is_private: false
|
||||||
num_stars: 0
|
num_stars: 0
|
||||||
num_forks: 0
|
num_forks: 0
|
||||||
|
@ -665,6 +682,7 @@
|
||||||
owner_name: org26
|
owner_name: org26
|
||||||
lower_name: repo_external_tracker_numeric
|
lower_name: repo_external_tracker_numeric
|
||||||
name: repo_external_tracker_numeric
|
name: repo_external_tracker_numeric
|
||||||
|
is_empty: false
|
||||||
is_private: false
|
is_private: false
|
||||||
num_stars: 0
|
num_stars: 0
|
||||||
num_forks: 0
|
num_forks: 0
|
||||||
|
@ -678,6 +696,7 @@
|
||||||
owner_name: org26
|
owner_name: org26
|
||||||
lower_name: repo_external_tracker_alpha
|
lower_name: repo_external_tracker_alpha
|
||||||
name: repo_external_tracker_alpha
|
name: repo_external_tracker_alpha
|
||||||
|
is_empty: false
|
||||||
is_private: false
|
is_private: false
|
||||||
num_stars: 0
|
num_stars: 0
|
||||||
num_forks: 0
|
num_forks: 0
|
||||||
|
@ -692,6 +711,7 @@
|
||||||
owner_name: user27
|
owner_name: user27
|
||||||
lower_name: repo49
|
lower_name: repo49
|
||||||
name: repo49
|
name: repo49
|
||||||
|
is_empty: false
|
||||||
is_private: false
|
is_private: false
|
||||||
num_stars: 0
|
num_stars: 0
|
||||||
num_forks: 0
|
num_forks: 0
|
||||||
|
@ -738,3 +758,13 @@
|
||||||
num_projects: 0
|
num_projects: 0
|
||||||
num_closed_projects: 0
|
num_closed_projects: 0
|
||||||
status: 0
|
status: 0
|
||||||
|
|
||||||
|
-
|
||||||
|
id: 52
|
||||||
|
owner_id: 30
|
||||||
|
owner_name: user30
|
||||||
|
lower_name: empty
|
||||||
|
name: empty
|
||||||
|
is_empty: true
|
||||||
|
is_private: true
|
||||||
|
status: 0
|
||||||
|
|
|
@ -522,7 +522,7 @@
|
||||||
is_restricted: true
|
is_restricted: true
|
||||||
avatar: avatar29
|
avatar: avatar29
|
||||||
avatar_email: user30@example.com
|
avatar_email: user30@example.com
|
||||||
num_repos: 2
|
num_repos: 3
|
||||||
is_active: true
|
is_active: true
|
||||||
prohibit_login: true
|
prohibit_login: true
|
||||||
|
|
||||||
|
|
|
@ -203,10 +203,10 @@ func TestGetContentsOrListErrors(t *testing.T) {
|
||||||
|
|
||||||
func TestGetContentsOrListOfEmptyRepos(t *testing.T) {
|
func TestGetContentsOrListOfEmptyRepos(t *testing.T) {
|
||||||
unittest.PrepareTestEnv(t)
|
unittest.PrepareTestEnv(t)
|
||||||
ctx := test.MockContext(t, "user2/repo15")
|
ctx := test.MockContext(t, "user30/empty")
|
||||||
ctx.SetParams(":id", "15")
|
ctx.SetParams(":id", "52")
|
||||||
test.LoadRepo(t, ctx, 15)
|
test.LoadRepo(t, ctx, 52)
|
||||||
test.LoadUser(t, ctx, 2)
|
test.LoadUser(t, ctx, 30)
|
||||||
test.LoadGitRepo(t, ctx)
|
test.LoadGitRepo(t, ctx)
|
||||||
defer ctx.Repo.GitRepo.Close()
|
defer ctx.Repo.GitRepo.Close()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue