diff options
author | Nick <nick.guenther@polymtl.ca> | 2022-12-22 18:41:56 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-23 07:41:56 +0800 |
commit | a2779def36590518157c4315a02e7cbaefcecb92 (patch) | |
tree | b7f9071ed8343842436eee5679c516dd8c982764 /models | |
parent | ea5a752ee66f5f8dccbc058c4e1220e24e01b3e8 (diff) | |
download | gitea-a2779def36590518157c4315a02e7cbaefcecb92.tar.gz gitea-a2779def36590518157c4315a02e7cbaefcecb92.zip |
Test views of LFS files (#22196)
Diffstat (limited to 'models')
-rw-r--r-- | models/db/iterate_test.go | 2 | ||||
-rw-r--r-- | models/fixtures/lfs_meta_object.yml | 32 | ||||
-rw-r--r-- | models/fixtures/repo_unit.yml | 6 | ||||
-rw-r--r-- | models/fixtures/repository.yml | 11 | ||||
-rw-r--r-- | models/fixtures/user.yml | 2 |
5 files changed, 51 insertions, 2 deletions
diff --git a/models/db/iterate_test.go b/models/db/iterate_test.go index 57b1bd3cd1..63487afa49 100644 --- a/models/db/iterate_test.go +++ b/models/db/iterate_test.go @@ -25,7 +25,7 @@ func TestIterate(t *testing.T) { return nil }) assert.NoError(t, err) - assert.EqualValues(t, 80, repoCnt) + assert.EqualValues(t, 81, repoCnt) err = db.Iterate(db.DefaultContext, nil, func(ctx context.Context, repoUnit *repo_model.RepoUnit) error { reopUnit2 := repo_model.RepoUnit{ID: repoUnit.ID} diff --git a/models/fixtures/lfs_meta_object.yml b/models/fixtures/lfs_meta_object.yml new file mode 100644 index 0000000000..1c29e02d44 --- /dev/null +++ b/models/fixtures/lfs_meta_object.yml @@ -0,0 +1,32 @@ +# These are the LFS objects in user2/lfs.git +- + + id: 1 + oid: 0b8d8b5f15046343fd32f451df93acc2bdd9e6373be478b968e4cad6b6647351 + size: 107 + repository_id: 54 + created_unix: 1671607299 + +- + + id: 2 + oid: 2eccdb43825d2a49d99d542daa20075cff1d97d9d2349a8977efe9c03661737c + size: 107 + repository_id: 54 + created_unix: 1671607299 + +- + + id: 3 + oid: 7b6b2c88dba9f760a1a58469b67fee2b698ef7e9399c4ca4f34a14ccbe39f623 + size: 27 + repository_id: 54 + created_unix: 1671607299 + +- + + id: 4 + oid: 9d172e5c64b4f0024b9901ec6afe9ea052f3c9b6ff9f4b07956d8c48c86fca82 + size: 25 + repository_id: 54 + created_unix: 1671607299 diff --git a/models/fixtures/repo_unit.yml b/models/fixtures/repo_unit.yml index 73db47218b..8706717ad4 100644 --- a/models/fixtures/repo_unit.yml +++ b/models/fixtures/repo_unit.yml @@ -550,3 +550,9 @@ repo_id: 53 type: 1 created_unix: 946684810 + +- + id: 81 + repo_id: 54 + type: 1 + created_unix: 946684810 diff --git a/models/fixtures/repository.yml b/models/fixtures/repository.yml index a5a3dd0601..19b243fb4e 100644 --- a/models/fixtures/repository.yml +++ b/models/fixtures/repository.yml @@ -1585,3 +1585,14 @@ size: 0 is_fsck_enabled: true close_issues_via_commit_in_any_branch: false + +- + id: 54 + owner_id: 2 + owner_name: user2 + lower_name: lfs + name: lfs + is_empty: false + is_archived: false + is_private: true + status: 0 diff --git a/models/fixtures/user.yml b/models/fixtures/user.yml index 1b870e8999..3afed37df9 100644 --- a/models/fixtures/user.yml +++ b/models/fixtures/user.yml @@ -66,7 +66,7 @@ num_followers: 2 num_following: 1 num_stars: 2 - num_repos: 9 + num_repos: 10 num_teams: 0 num_members: 0 visibility: 0 |