Tests: Update fixtures

This commit is contained in:
theresa
2021-07-22 15:05:23 +02:00
parent dcebf32c2c
commit de1eee18bf
6 changed files with 38 additions and 14 deletions

View File

@@ -29,6 +29,14 @@ var DetailsFixtures = DetailsMap{
Artist: "Hans",
Copyright: "copy",
License: "MIT",
CreatedAt: Timestamp(),
UpdatedAt: Timestamp(),
KeywordsSrc: "meta",
NotesSrc: "manual",
SubjectSrc: "meta",
ArtistSrc: "meta",
CopyrightSrc: "manual",
LicenseSrc: "manual",
},
"blacklist": {
PhotoID: 1000001,
@@ -38,6 +46,14 @@ var DetailsFixtures = DetailsMap{
Artist: "Hans",
Copyright: "copy",
License: "MIT",
CreatedAt: Timestamp(),
UpdatedAt: Timestamp(),
KeywordsSrc: "",
NotesSrc: "",
SubjectSrc: "meta",
ArtistSrc: "meta",
CopyrightSrc: "manual",
LicenseSrc: "manual",
},
"bridge": {
PhotoID: 1000003,
@@ -47,5 +63,13 @@ var DetailsFixtures = DetailsMap{
Artist: "Jens Mander",
Copyright: "Copyright 2020",
License: "n/a",
CreatedAt: Timestamp(),
UpdatedAt: Timestamp(),
KeywordsSrc: "meta",
NotesSrc: "manual",
SubjectSrc: "meta",
ArtistSrc: "meta",
CopyrightSrc: "manual",
LicenseSrc: "manual",
},
}

View File

@@ -26,7 +26,7 @@ var FileShareFixtures = FileShareMap{
"FileShare1": {
FileID: 1000000,
AccountID: 1000000,
RemoteName: "name for remote",
RemoteName: "/20100729-015747-Urlaub-2010.jpg",
Status: FileShareShared,
Error: "",
Errors: 0,
@@ -38,7 +38,7 @@ var FileShareFixtures = FileShareMap{
"FileShare2": {
FileID: 1000000,
AccountID: 1000001,
RemoteName: "name for remote",
RemoteName: "/20200729-015747-Dog-2020.jpg",
Status: FileShareNew,
Error: "",
Errors: 0,

View File

@@ -10,7 +10,7 @@ func TestFileShareMap_Get(t *testing.T) {
t.Run("get existing fileshare", func(t *testing.T) {
r := FileShareFixtures.Get("FileShare1", 0, 0, "")
assert.Equal(t, uint(1000000), r.AccountID)
assert.Equal(t, "name for remote", r.RemoteName)
assert.Equal(t, "/20100729-015747-Urlaub-2010.jpg", r.RemoteName)
assert.IsType(t, FileShare{}, r)
})
t.Run("get not existing fileshare", func(t *testing.T) {
@@ -25,7 +25,7 @@ func TestFileShareMap_Pointer(t *testing.T) {
t.Run("get existing fileshare pointer", func(t *testing.T) {
r := FileShareFixtures.Pointer("FileShare1", 0, 0, "")
assert.Equal(t, uint(1000000), r.AccountID)
assert.Equal(t, "name for remote", r.RemoteName)
assert.Equal(t, "/20100729-015747-Urlaub-2010.jpg", r.RemoteName)
assert.IsType(t, &FileShare{}, r)
})
t.Run("get not existing fileshare pointer", func(t *testing.T) {

View File

@@ -26,8 +26,8 @@ var FileSyncFixtures = FileSyncMap{
"FileSync1": {
FileID: 1000000,
AccountID: 1000000,
RemoteName: "name for remote sync",
Status: "test",
RemoteName: "/20200706-092527-Landscape-München-2020.jpg",
Status: "uploaded",
Error: "",
Errors: 0,
File: &FileFixturesExampleJPG,
@@ -40,28 +40,28 @@ var FileSyncFixtures = FileSyncMap{
"FileSync2": {
FileID: 1000000,
AccountID: 1000001,
RemoteName: "name for remote sync",
Status: "test",
RemoteName: "/20200706-092527-Landscape-Hamburg-2020.jpg",
Status: "downloaded",
Error: "",
Errors: 0,
File: &FileFixturesExampleJPG,
Account: &AccountFixtureWebdavDummy2,
RemoteDate: time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
RemoteSize: int64(60),
RemoteSize: int64(160),
CreatedAt: time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
UpdatedAt: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
},
"FileSync3": {
FileID: 1000000,
AccountID: 1000000,
RemoteName: "name for remote sync",
RemoteName: "/20200706-092527-People-2020.jpg",
Status: "new",
Error: "",
Errors: 0,
File: &FileFixturesExampleJPG,
Account: &AccountFixtureWebdavDummy,
RemoteDate: time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
RemoteSize: int64(60),
RemoteSize: int64(860),
CreatedAt: time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC),
UpdatedAt: time.Date(2020, 1, 1, 0, 0, 0, 0, time.UTC),
},

View File

@@ -10,7 +10,7 @@ func TestFileSyncMap_Get(t *testing.T) {
t.Run("get existing filesync", func(t *testing.T) {
r := FileSyncFixtures.Get("FileSync1", 0, "")
assert.Equal(t, uint(1000000), r.AccountID)
assert.Equal(t, "name for remote sync", r.RemoteName)
assert.Equal(t, "/20200706-092527-Landscape-München-2020.jpg", r.RemoteName)
assert.IsType(t, FileSync{}, r)
})
t.Run("get not existing filesync", func(t *testing.T) {
@@ -25,7 +25,7 @@ func TestFileSyncMap_Pointer(t *testing.T) {
t.Run("get existing filesync pointer", func(t *testing.T) {
r := FileSyncFixtures.Pointer("FileSync1", 0, "")
assert.Equal(t, uint(1000000), r.AccountID)
assert.Equal(t, "name for remote sync", r.RemoteName)
assert.Equal(t, "/20200706-092527-Landscape-München-2020.jpg", r.RemoteName)
assert.IsType(t, &FileSync{}, r)
})
t.Run("get not existing filesync pointer", func(t *testing.T) {

View File

@@ -9,7 +9,7 @@ import (
func TestFileSyncs(t *testing.T) {
t.Run("success", func(t *testing.T) {
r, err := FileSyncs(uint(1000001), "test", 10)
r, err := FileSyncs(uint(1000001), "downloaded", 10)
if err != nil {
t.Fatal(err)
}