A lot of work with albums and photos, still working but want to save working tests/methods

Signed-off-by: Kris Nóva <kris@nivenly.com>
main
Kris Nóva 2021-02-11 17:16:37 -08:00
parent 6436478402
commit 194f0acb28
79 changed files with 1028 additions and 23 deletions

View File

@ -111,7 +111,7 @@ func (v1 *V1Client) DislikeAlbum(uuid string) error {
}
// POST /api/v1/albums/:uid/clone
func (v1 *V1Client) CloneAlbums(object Album) (Album, error) {
func (v1 *V1Client) CloneAlbum(object Album) (Album, error) {
if object.AlbumUID == "" {
return object, fmt.Errorf("missing album.AlbumUID in album")
}
@ -121,14 +121,24 @@ func (v1 *V1Client) CloneAlbums(object Album) (Album, error) {
}
// POST /api/v1/albums/:uid/photos
func (v1 *V1Client) AddPhotosToAlbum(albumUUID string, objects []Photo) error {
resp := v1.POST(&objects, "/api/v1/albums/%s/photos", albumUUID)
func (v1 *V1Client) AddPhotosToAlbum(albumUUID string, photoIDs []string) error {
payload := struct {
Photos []string `json:"photos"`
}{
Photos: photoIDs,
}
resp := v1.POST(&payload, "/api/v1/albums/%s/photos", albumUUID)
return resp.Error
}
// DELETE /api/v1/albums/:uid/photos
func (v1 *V1Client) DeletePhotosFromAlbum(albumUUID string, objects []Photo) error {
resp := v1.DELETE(&objects, "/api/v1/albums/%s/photos", albumUUID)
func (v1 *V1Client) DeletePhotosFromAlbum(albumUUID string, photoIDs []string) error {
payload := struct {
Photos []string `json:"photos"`
}{
Photos: photoIDs,
}
resp := v1.DELETE(&payload, "/api/v1/albums/%s/photos", albumUUID)
return resp.Error
}

View File

@ -4,11 +4,12 @@ import (
"bytes"
"encoding/json"
"fmt"
"github.com/kris-nova/logger"
"io/ioutil"
"net/http"
"net/url"
"strings"
"github.com/kris-nova/logger"
)
const (

13
api/v1/index.go 100644
View File

@ -0,0 +1,13 @@
package api
// POST /api/v1/index
func (v1 *V1Client) Index() error {
resp := v1.POST(nil, "/api/v1/index")
return resp.Error
}
// DELETE /api/v1/index
func (v1 *V1Client) CancelIndex() error {
resp := v1.DELETE(nil, "/api/v1/index")
return resp.Error
}

View File

@ -1,7 +1,5 @@
package api
// GET /api/v1/photos/:uuid
//
// Parameters:
@ -14,6 +12,52 @@ func (v1 *V1Client) GetPhoto(uuid string) (Photo, error) {
return object, err
}
type PhotoOptions struct {
Count int
Offset int
AlbumUID string
Filter string
Merged bool
Country string
Camera int
Order string
Q string
}
const (
DefaultPhotoOptionsCount = 60
DefaultPhotoOptionsOffset = 0
DefaultPhotoOptionsMerged = true
DefaultPhotoOptionsCamera = 0
DefaultPhotoOptionsOrder = "oldest"
)
// GET /api/v1/photos/
//
// http://localhost:8080/api/v1/photos?
// count=60&offset=0&album=aqoe4m9204aigugh&filter=&merged=true&country=&camera=0&order=oldest&q=
func (v1 *V1Client) GetPhotos(options *PhotoOptions) ([]Photo, error) {
var photos []Photo
if options == nil {
options = &PhotoOptions{
Count: DefaultPhotoOptionsCount,
Offset: DefaultPhotoOptionsOffset,
Merged: DefaultPhotoOptionsMerged,
Order: DefaultPhotoOptionsOrder,
Camera: DefaultPhotoOptionsCamera,
}
}
if options.Count == 0 {
return photos, nil
}
if options.Order == "" {
options.Order = DefaultPhotoOptionsOrder
}
err := v1.GET("/api/v1/photos?count=%d&offset=%d&album=%s&filter=%s&merged=%t&country=%s&camera=%d&order=%s&q=%s",
options.Count, options.Offset, options.AlbumUID, options.Filter, options.Merged, options.Country, options.Camera, options.Order, options.Q).JSON(&photos)
return photos, err
}
// PUT /api/v1/photos/:uid
//
// Parameters:

View File

@ -5,10 +5,12 @@ import (
"time"
)
type Photos []Photo
// Photo represents a photo, all its properties, and link to all its images and sidecar files.
type Photo struct {
Meta
ID uint `gorm:"primary_key" yaml:"-"`
//ID uint `gorm:"primary_key" yaml:"-"`
UUID string `gorm:"type:VARBINARY(42);index;" json:"DocumentID,omitempty" yaml:"DocumentID,omitempty"`
TakenAt time.Time `gorm:"type:datetime;index:idx_photos_taken_uid;" json:"TakenAt" yaml:"TakenAt"`
TakenAtLocal time.Time `gorm:"type:datetime;" yaml:"-"`
@ -52,13 +54,13 @@ type Photo struct {
CameraSrc string `gorm:"type:VARBINARY(8);" json:"CameraSrc" yaml:"-"`
LensID uint `gorm:"index:idx_photos_camera_lens;default:1" json:"LensID" yaml:"-"`
Details *Details `gorm:"association_autoupdate:false;association_autocreate:false;association_save_reference:false" json:"Details" yaml:"Details"`
Camera *Camera `gorm:"association_autoupdate:false;association_autocreate:false;association_save_reference:false" json:"Camera" yaml:"-"`
Lens *Lens `gorm:"association_autoupdate:false;association_autocreate:false;association_save_reference:false" json:"Lens" yaml:"-"`
Cell *Cell `gorm:"association_autoupdate:false;association_autocreate:false;association_save_reference:false" json:"Cell" yaml:"-"`
Place *Place `gorm:"association_autoupdate:false;association_autocreate:false;association_save_reference:false" json:"Place" yaml:"-"`
Keywords []Keyword `json:"-" yaml:"-"`
Albums []Album `json:"-" yaml:"-"`
Files []File `yaml:"-"`
Camera *Camera `gorm:"association_autoupdate:false;association_autocreate:false;association_save_reference:false" json:"Camera" yaml:"-"`
Lens *Lens `gorm:"association_autoupdate:false;association_autocreate:false;association_save_reference:false" json:"Lens" yaml:"-"`
Cell *Cell `gorm:"association_autoupdate:false;association_autocreate:false;association_save_reference:false" json:"Cell" yaml:"-"`
Place *Place `gorm:"association_autoupdate:false;association_autocreate:false;association_save_reference:false" json:"Place" yaml:"-"`
Keywords []Keyword `json:"-" yaml:"-"`
Albums []Album `json:"-" yaml:"-"`
Files []File `yaml:"-"`
//Labels []PhotoLabel `yaml:"-"`
CreatedAt time.Time `yaml:"CreatedAt,omitempty"`
UpdatedAt time.Time `yaml:"UpdatedAt,omitempty"`
@ -193,7 +195,6 @@ type PhotoAlbum struct {
Album *Album `gorm:"PRELOAD:true" yaml:"-"`
}
// File represents an image or sidecar file that belongs to a photo.
type File struct {
ID uint `gorm:"primary_key" json:"-" yaml:"-"`
@ -267,7 +268,6 @@ type FileShare struct {
UpdatedAt time.Time
}
// PhotoLabel represents the many-to-many relation between Photo and label.
// Labels are weighted by uncertainty (100 - confidence)
type PhotoLabel struct {

View File

@ -7,3 +7,4 @@ Order: oldest
Country: zz
CreatedAt: 2021-02-11T23:22:42Z
UpdatedAt: 2021-02-11T23:22:42.31692892Z
DeletedAt: 2021-02-12T00:14:52.285222547Z

View File

@ -7,3 +7,4 @@ Order: oldest
Country: zz
CreatedAt: 2021-02-11T23:25:16Z
UpdatedAt: 2021-02-11T23:25:15.61908592Z
DeletedAt: 2021-02-12T00:14:52.285222547Z

View File

@ -6,3 +6,4 @@ Order: oldest
Country: zz
CreatedAt: 2021-02-11T23:29:33Z
UpdatedAt: 2021-02-11T23:29:33Z
DeletedAt: 2021-02-12T00:14:52.285222547Z

View File

@ -6,3 +6,4 @@ Order: oldest
Country: zz
CreatedAt: 2021-02-11T23:31:08Z
UpdatedAt: 2021-02-11T23:31:08Z
DeletedAt: 2021-02-11T23:31:08.058407849Z

View File

@ -7,3 +7,4 @@ Order: oldest
Country: zz
CreatedAt: 2021-02-11T23:31:41Z
UpdatedAt: 2021-02-11T23:31:40.791556222Z
DeletedAt: 2021-02-11T23:31:40.798855984Z

View File

@ -0,0 +1,10 @@
UID: aqoe1mn3669ed8vc
Slug: testalbum
Type: album
Title: TestAlbum
Description: An updated album description
Order: oldest
Country: zz
CreatedAt: 2021-02-11T23:37:36Z
UpdatedAt: 2021-02-11T23:37:35.931076271Z
DeletedAt: 2021-02-11T23:37:35.938663557Z

View File

@ -0,0 +1,9 @@
UID: aqoe1mnib00h33mh
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-11T23:37:36Z
UpdatedAt: 2021-02-11T23:37:36Z
DeletedAt: 2021-02-11T23:37:35.984813813Z

View File

@ -0,0 +1,9 @@
UID: aqoe1su2yz12rn7r
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-11T23:41:19Z
UpdatedAt: 2021-02-11T23:41:19Z
DeletedAt: 2021-02-11T23:41:18.568153261Z

View File

@ -0,0 +1,10 @@
UID: aqoe1su312pday8a
Slug: testalbum
Type: album
Title: TestAlbum
Description: An updated album description
Order: oldest
Country: zz
CreatedAt: 2021-02-11T23:41:18Z
UpdatedAt: 2021-02-11T23:41:18.505274668Z
DeletedAt: 2021-02-11T23:41:18.517183797Z

View File

@ -0,0 +1,9 @@
UID: aqoe1su3gj3q7mrk
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-11T23:41:19Z
UpdatedAt: 2021-02-11T23:41:19Z
DeletedAt: 2021-02-11T23:41:18.592298473Z

View File

@ -0,0 +1,9 @@
UID: aqoe2nw1mc3m0c95
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-11T23:59:57Z
UpdatedAt: 2021-02-11T23:59:57Z
DeletedAt: 2021-02-11T23:59:56.834221161Z

View File

@ -0,0 +1,9 @@
UID: aqoe2nw2mtjrlyuq
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-11T23:59:57Z
UpdatedAt: 2021-02-11T23:59:57Z
DeletedAt: 2021-02-11T23:59:56.78263971Z

View File

@ -0,0 +1,9 @@
UID: aqoe2nw310xqz9f1
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-11T23:59:57Z
UpdatedAt: 2021-02-11T23:59:57Z
DeletedAt: 2021-02-11T23:59:56.805849627Z

View File

@ -0,0 +1,10 @@
UID: aqoe2nws4nefmwtt
Slug: testalbum
Type: album
Title: TestAlbum
Description: An updated album description
Order: oldest
Country: zz
CreatedAt: 2021-02-11T23:59:57Z
UpdatedAt: 2021-02-11T23:59:56.727315788Z
DeletedAt: 2021-02-11T23:59:56.734742155Z

View File

@ -0,0 +1,9 @@
UID: aqoe2u021a4zjufp
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-12T00:03:37Z
UpdatedAt: 2021-02-12T00:03:37Z
DeletedAt: 2021-02-12T00:03:36.899233684Z

View File

@ -0,0 +1,9 @@
UID: aqoe2u0299hfp9uf
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-12T00:03:37Z
UpdatedAt: 2021-02-12T00:03:37Z
DeletedAt: 2021-02-12T00:03:36.927067016Z

View File

@ -0,0 +1,10 @@
UID: aqoe2u03t1k09mbq
Slug: testalbum
Type: album
Title: TestAlbum
Description: An updated album description
Order: oldest
Country: zz
CreatedAt: 2021-02-12T00:03:37Z
UpdatedAt: 2021-02-12T00:03:36.846932177Z
DeletedAt: 2021-02-12T00:03:36.854999187Z

View File

@ -0,0 +1,9 @@
UID: aqoe2u0zakwm0kh4
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-12T00:03:37Z
UpdatedAt: 2021-02-12T00:03:37Z
DeletedAt: 2021-02-12T00:03:36.955701902Z

View File

@ -0,0 +1,10 @@
UID: aqoe2y1x2v9ulekw
Slug: testalbum
Type: album
Title: TestAlbum
Description: An updated album description
Order: oldest
Country: zz
CreatedAt: 2021-02-12T00:06:02Z
UpdatedAt: 2021-02-12T00:06:01.997666242Z
DeletedAt: 2021-02-12T00:06:02.008962725Z

View File

@ -0,0 +1,9 @@
UID: aqoe2y233f9xc3me
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-12T00:06:02Z
UpdatedAt: 2021-02-12T00:06:02Z
DeletedAt: 2021-02-12T00:06:02.061930815Z

View File

@ -0,0 +1,9 @@
UID: aqoe2y23iah7q8dd
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-12T00:06:02Z
UpdatedAt: 2021-02-12T00:06:02Z
DeletedAt: 2021-02-12T00:06:02.107878556Z

View File

@ -0,0 +1,9 @@
UID: aqoe2y23n8shfo26
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-12T00:06:02Z
UpdatedAt: 2021-02-12T00:06:02Z
DeletedAt: 2021-02-12T00:06:02.083118581Z

View File

@ -0,0 +1,9 @@
UID: aqoe310mqejp7sjx
Slug: novaalbum
Type: album
Title: NovaAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-12T00:07:48Z
UpdatedAt: 2021-02-12T00:07:48Z
DeletedAt: 2021-02-12T00:07:48.087397413Z

View File

@ -0,0 +1,10 @@
UID: aqoe3di2oe0gj7eb
Slug: testalbum
Type: album
Title: TestAlbum
Description: An updated album description
Order: oldest
Country: zz
CreatedAt: 2021-02-12T00:15:18Z
UpdatedAt: 2021-02-12T00:15:18.326635885Z
DeletedAt: 2021-02-12T00:15:18.337623732Z

View File

@ -0,0 +1,9 @@
UID: aqoe3di3f013g098
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-12T00:15:18Z
UpdatedAt: 2021-02-12T00:15:18Z
DeletedAt: 2021-02-12T00:15:18.387748516Z

View File

@ -0,0 +1,9 @@
UID: aqoe3di3rfrp4osq
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-12T00:15:18Z
UpdatedAt: 2021-02-12T00:15:18Z
DeletedAt: 2021-02-12T00:15:18.417353099Z

View File

@ -0,0 +1,9 @@
UID: aqoe3di9wl91qjy1
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-12T00:15:18Z
UpdatedAt: 2021-02-12T00:15:18Z
DeletedAt: 2021-02-12T00:15:18.441462643Z

View File

@ -0,0 +1,9 @@
UID: aqoe3go3alpu9g42
Slug: february-2021-2
Type: album
Title: February 2021 (2)
Order: oldest
Country: zz
CreatedAt: 2021-02-12T00:17:12Z
UpdatedAt: 2021-02-12T00:17:12Z
DeletedAt: 2021-02-12T00:25:55.610343844Z

View File

@ -0,0 +1,9 @@
UID: aqoe3sj140onsu3u
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-12T00:24:20Z
UpdatedAt: 2021-02-12T00:24:20Z
DeletedAt: 2021-02-12T00:24:19.584898324Z

View File

@ -0,0 +1,10 @@
UID: aqoe3sj2oim76rfl
Slug: testalbum
Type: album
Title: TestAlbum
Description: An updated album description
Order: oldest
Country: zz
CreatedAt: 2021-02-12T00:24:19Z
UpdatedAt: 2021-02-12T00:24:19.452079212Z
DeletedAt: 2021-02-12T00:24:19.46454459Z

View File

@ -0,0 +1,9 @@
UID: aqoe3sj3d9vpwfs6
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-12T00:24:19Z
UpdatedAt: 2021-02-12T00:24:19Z
DeletedAt: 2021-02-12T00:24:19.513541437Z

View File

@ -0,0 +1,9 @@
UID: aqoe3sj5v7uxy0xi
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-12T00:24:20Z
UpdatedAt: 2021-02-12T00:24:20Z
DeletedAt: 2021-02-12T00:24:19.539899181Z

View File

@ -0,0 +1,10 @@
UID: aqoe3uk1ztdf4ly1
Slug: testalbum
Type: album
Title: TestAlbum
Description: An updated album description
Order: oldest
Country: zz
CreatedAt: 2021-02-12T00:25:32Z
UpdatedAt: 2021-02-12T00:25:32.382246374Z
DeletedAt: 2021-02-12T00:25:32.39451528Z

View File

@ -0,0 +1,9 @@
UID: aqoe3uk2ssh3wlmu
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-12T00:25:32Z
UpdatedAt: 2021-02-12T00:25:32Z
DeletedAt: 2021-02-12T00:25:32.501491328Z

View File

@ -0,0 +1,9 @@
UID: aqoe3uk3quu1oau5
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-12T00:25:32Z
UpdatedAt: 2021-02-12T00:25:32Z
DeletedAt: 2021-02-12T00:25:32.438255604Z

View File

@ -0,0 +1,9 @@
UID: aqoe3ukef6k7pr1n
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-12T00:25:32Z
UpdatedAt: 2021-02-12T00:25:32Z
DeletedAt: 2021-02-12T00:25:32.457679012Z

View File

@ -0,0 +1,10 @@
UID: aqoe43017x1x557a
Slug: testalbum
Type: album
Title: TestAlbum
Description: An updated album description
Order: oldest
Country: zz
CreatedAt: 2021-02-12T00:30:36Z
UpdatedAt: 2021-02-12T00:30:36.452565204Z
DeletedAt: 2021-02-12T00:30:36.466024116Z

View File

@ -0,0 +1,9 @@
UID: aqoe43038gpo8o62
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-12T00:30:37Z
UpdatedAt: 2021-02-12T00:30:37Z
DeletedAt: 2021-02-12T00:30:36.541728272Z

View File

@ -0,0 +1,9 @@
UID: aqoe4303e2k7fowx
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-12T00:30:36Z
UpdatedAt: 2021-02-12T00:30:36Z
DeletedAt: 2021-02-12T00:30:36.515616836Z

View File

@ -0,0 +1,9 @@
UID: aqoe430hjepljox7
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-12T00:30:37Z
UpdatedAt: 2021-02-12T00:30:37Z
DeletedAt: 2021-02-12T00:30:36.590399562Z

View File

@ -0,0 +1,9 @@
UID: aqoe46u1y7nllowc
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-12T00:32:55Z
UpdatedAt: 2021-02-12T00:32:55Z
DeletedAt: 2021-02-12T00:32:54.670452125Z

View File

@ -0,0 +1,10 @@
UID: aqoe46u2eytps9ks
Slug: testalbum
Type: album
Title: TestAlbum
Description: An updated album description
Order: oldest
Country: zz
CreatedAt: 2021-02-12T00:32:55Z
UpdatedAt: 2021-02-12T00:32:54.621067369Z
DeletedAt: 2021-02-12T00:32:54.629069306Z

View File

@ -0,0 +1,9 @@
UID: aqoe46ugvoopsx2c
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-12T00:32:55Z
UpdatedAt: 2021-02-12T00:32:55Z
DeletedAt: 2021-02-12T00:32:54.738939626Z

View File

@ -0,0 +1,9 @@
UID: aqoe46uh3251f3o5
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-12T00:32:55Z
UpdatedAt: 2021-02-12T00:32:55Z
DeletedAt: 2021-02-12T00:32:54.694577526Z

View File

@ -0,0 +1,9 @@
UID: aqoe4k41ws8kl303
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-12T00:40:52Z
UpdatedAt: 2021-02-12T00:40:52Z
DeletedAt: 2021-02-12T00:40:52.236143624Z

View File

@ -0,0 +1,10 @@
UID: aqoe4k420c8937zq
Slug: testalbum
Type: album
Title: TestAlbum
Description: An updated album description
Order: oldest
Country: zz
CreatedAt: 2021-02-12T00:40:52Z
UpdatedAt: 2021-02-12T00:40:52.149620745Z
DeletedAt: 2021-02-12T00:40:52.157633931Z

View File

@ -0,0 +1,9 @@
UID: aqoe4k423kseyeok
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-12T00:40:52Z
UpdatedAt: 2021-02-12T00:40:52Z
DeletedAt: 2021-02-12T00:40:52.205835621Z

View File

@ -0,0 +1,9 @@
UID: aqoe4k42wb7vdpy4
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-12T00:40:52Z
UpdatedAt: 2021-02-12T00:40:52Z
DeletedAt: 2021-02-12T00:40:52.346059642Z

View File

@ -0,0 +1,9 @@
UID: aqoe4m917yd0x5d8
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-12T00:42:10Z
UpdatedAt: 2021-02-12T00:42:10Z
DeletedAt: 2021-02-12T00:42:09.739048804Z

View File

@ -0,0 +1,10 @@
UID: aqoe4m91dd475mc2
Slug: testalbum
Type: album
Title: TestAlbum
Description: An updated album description
Order: oldest
Country: zz
CreatedAt: 2021-02-12T00:42:10Z
UpdatedAt: 2021-02-12T00:42:09.68534495Z
DeletedAt: 2021-02-12T00:42:09.697602792Z

View File

@ -0,0 +1,11 @@
UID: aqoe4m9204aigugh
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-12T00:42:10Z
UpdatedAt: 2021-02-12T00:42:10Z
Photos:
- UID: pqnzigq351j2fqgn
CreatedAt: 2021-02-12T00:42:09.791065836Z

View File

@ -0,0 +1,9 @@
UID: aqoe4m93kl5118yf
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-12T00:42:10Z
UpdatedAt: 2021-02-12T00:42:10Z
DeletedAt: 2021-02-12T00:42:09.764632667Z

View File

@ -0,0 +1,9 @@
UID: aqoe5s018umhsg2z
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-12T01:07:12Z
UpdatedAt: 2021-02-12T01:07:12Z
DeletedAt: 2021-02-12T01:07:12.278795475Z

View File

@ -0,0 +1,10 @@
UID: aqoe5s02eypzy49n
Slug: testalbum
Type: album
Title: TestAlbum
Description: An updated album description
Order: oldest
Country: zz
CreatedAt: 2021-02-12T01:07:12Z
UpdatedAt: 2021-02-12T01:07:12.18606883Z
DeletedAt: 2021-02-12T01:07:12.20368425Z

View File

@ -0,0 +1,9 @@
UID: aqoe5s02htbyx02a
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-12T01:07:12Z
UpdatedAt: 2021-02-12T01:07:12Z
DeletedAt: 2021-02-12T01:07:12.25672608Z

View File

@ -0,0 +1,9 @@
UID: aqoe5s0kcesnf038
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-12T01:07:12Z
UpdatedAt: 2021-02-12T01:07:12Z
DeletedAt: 2021-02-12T01:07:12.311501625Z

View File

@ -0,0 +1,9 @@
UID: aqoe5um2nxaam1jf
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-12T01:08:46Z
UpdatedAt: 2021-02-12T01:08:46Z
DeletedAt: 2021-02-12T01:08:46.441203314Z

View File

@ -0,0 +1,10 @@
UID: aqoe5um3k2bjzdz3
Slug: testalbum
Type: album
Title: TestAlbum
Description: An updated album description
Order: oldest
Country: zz
CreatedAt: 2021-02-12T01:08:46Z
UpdatedAt: 2021-02-12T01:08:46.349964437Z
DeletedAt: 2021-02-12T01:08:46.364581421Z

View File

@ -0,0 +1,9 @@
UID: aqoe5umo46cx9up1
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-12T01:08:46Z
UpdatedAt: 2021-02-12T01:08:46Z
DeletedAt: 2021-02-12T01:08:46.414981534Z

View File

@ -0,0 +1,9 @@
UID: aqoe5zd1dhchzyrt
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-12T01:11:37Z
UpdatedAt: 2021-02-12T01:11:37Z
DeletedAt: 2021-02-12T01:11:37.410053582Z

View File

@ -0,0 +1,10 @@
UID: aqoe5zd1n8nyjezg
Slug: testalbum
Type: album
Title: TestAlbum
Description: An updated album description
Order: oldest
Country: zz
CreatedAt: 2021-02-12T01:11:37Z
UpdatedAt: 2021-02-12T01:11:37.317189151Z
DeletedAt: 2021-02-12T01:11:37.337078186Z

View File

@ -0,0 +1,9 @@
UID: aqoe5zdgv8bbtzbn
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-12T01:11:37Z
UpdatedAt: 2021-02-12T01:11:37Z
DeletedAt: 2021-02-12T01:11:37.38408389Z

View File

@ -0,0 +1,10 @@
UID: aqoe63g15cp92acg
Slug: testalbum
Type: album
Title: TestAlbum
Description: An updated album description
Order: oldest
Country: zz
CreatedAt: 2021-02-12T01:14:05Z
UpdatedAt: 2021-02-12T01:14:04.617839652Z
DeletedAt: 2021-02-12T01:14:04.630483844Z

View File

@ -0,0 +1,9 @@
UID: aqoe63g1hvf4c37t
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-12T01:14:05Z
UpdatedAt: 2021-02-12T01:14:05Z
DeletedAt: 2021-02-12T01:14:04.683342935Z

View File

@ -0,0 +1,9 @@
UID: aqoe63g1wp37dwns
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-12T01:14:05Z
UpdatedAt: 2021-02-12T01:14:05Z
DeletedAt: 2021-02-12T01:14:04.720807005Z

View File

@ -0,0 +1,10 @@
UID: aqoe66r266y7x2ct
Slug: testalbum
Type: album
Title: TestAlbum
Description: An updated album description
Order: oldest
Country: zz
CreatedAt: 2021-02-12T01:16:03Z
UpdatedAt: 2021-02-12T01:16:03.089952155Z
DeletedAt: 2021-02-12T01:16:03.103617951Z

View File

@ -0,0 +1,9 @@
UID: aqoe66r304v81itt
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-12T01:16:03Z
UpdatedAt: 2021-02-12T01:16:03Z
DeletedAt: 2021-02-12T01:16:03.147574525Z

View File

@ -0,0 +1,9 @@
UID: aqoe66r3bjgymp2o
Slug: testalbum
Type: album
Title: TestAlbum
Order: oldest
Country: zz
CreatedAt: 2021-02-12T01:16:03Z
UpdatedAt: 2021-02-12T01:16:03Z
DeletedAt: 2021-02-12T01:16:03.168746489Z

View File

@ -19,11 +19,21 @@
"tokens": null,
"expiration": 1613675155095051774
},
"07c2bbcb1df220261ea59e51cb729aa36a792270cbb1d2e6": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
"expiration": 1613694636430173234
},
"0957017ab9576154468a8a0df5fd74798be6965b3f5eef90": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
"expiration": 1613523028656083744
},
"0b41fe7fdd8394795d0fd77aa68f1761178a50abeec9c368": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
"expiration": 1613694332360000052
},
"0bab87ab1e73344a73e4693465cfa7cd20bc3a448c11db72": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
@ -44,6 +54,11 @@
"tokens": null,
"expiration": 1613501612939596202
},
"0dc38cde05d9e5740a9e37f2748baddca7c46afd1f838cb4": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
"expiration": 1613691457078516123
},
"0f257f1b73a31dbb0cf7209bfdf46c02094f99da64e21e05": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
@ -64,6 +79,11 @@
"tokens": null,
"expiration": 1613502823940492608
},
"14387dc41c2f75afa289e88f15f055295e85927dcdc1c2a9": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
"expiration": 1613693016825633348
},
"163e08d6fc94c7c7c07f1af8638fd5db4aa929b0462d5548": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
@ -89,6 +109,11 @@
"tokens": null,
"expiration": 1613519857033524517
},
"22d46e54121f85c332e42948827f7604dc09fb46929796e8": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
"expiration": 1613695252131862322
},
"2521ed30985fb1991e3d1271cbf6e2b53840d614647361af": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
@ -119,6 +144,16 @@
"tokens": null,
"expiration": 1613500923020420449
},
"2dd6d162775366330abeb66b1e04c4e2baac2dd773c435dc": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
"expiration": 1613695329661942849
},
"2ee26b2287c528af16c9f9102371c71bb6b4235cdfad4c17": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
"expiration": 1613696833569070827
},
"3201e2a3c31f05c72057a8219ef18418d794dd68ebb6da5a": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
@ -209,11 +244,31 @@
"tokens": null,
"expiration": 1613683106227931942
},
"4ca01d7b57983db5506fbf14a253437f4a4327cc9c416e2f": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
"expiration": 1613697244595185056
},
"5013c7649a605d60acdacbb8471c13d13c184207ae632d74": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
"expiration": 1613693163291656795
},
"50d59fc456069245c1fb3862de9faaa06bed34a363347b03": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
"expiration": 1613697363065863348
},
"5225f5600acaefec701d3ab1f3cfe2cf4b10ad025f2bf58e": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
"expiration": 1613512362197250367
},
"5233ac815403a62faaa51cea93b3a24c8208cbd7ae996619": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
"expiration": 1613691455910293847
},
"542cf5000fd4adbc7d1b7d6f2919b3d73afcb4620784adb0": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
@ -244,16 +299,36 @@
"tokens": null,
"expiration": 1613502564441892628
},
"5c57ac112bc4c8c0e2a6ffd1736ff5e6c28e804022b5c934": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
"expiration": 1613696927682100180
},
"5cddcd34e5e1ec2e4c27731e2f205a25faf5dde9e43974be": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
"expiration": 1613694333640204990
},
"5d748cc67c9c4efec35d910f799113b793a9fc47f9d88bd5": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
"expiration": 1613686778812288997
},
"5fccb8ed1ac9f5ca4152b071128078b3da8810e88c1d9728": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
"expiration": 1613697364465122850
},
"6196c51bd2db97cc8aeaaac53bef1c6400c50774fedc97b5": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
"expiration": 1613512018478271866
},
"674e45bdf14a7b5d6ad2cd21211bebc60930030621c64e1b": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
"expiration": 1613692798100018887
},
"69a5ba6601a0b258d6437ec792376eb0401c31b03b786629": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
@ -304,6 +379,11 @@
"tokens": null,
"expiration": 1613685000623682231
},
"812e28420b9f150c4469ddfd9b8f42176cdf30eb2bb2aa30": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
"expiration": 1613691679743858579
},
"8173f5cece02b1a41e9bc937bbbbc80960b838d93cef7f2d": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
@ -319,6 +399,11 @@
"tokens": null,
"expiration": 1613519957592232701
},
"84de25dc7ae05b3ecac64025982d1b63fd3886964f2400a5": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
"expiration": 1613697098703845654
},
"84f19033c3b06fbfb1493bed3e316a29a2d1c1864fb84b7c": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
@ -329,6 +414,11 @@
"tokens": null,
"expiration": 1613690562297926322
},
"86d5676ec062851e44ab241820311b31efd7ca9b4909952d": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
"expiration": 1613697097293896752
},
"86e47c8475bbab147dc714ca6ae10b2ea64471d20a74e248": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
@ -349,6 +439,11 @@
"tokens": null,
"expiration": 1613675036520289034
},
"8c913bdc6bb46b9bf04573932ec058cf4efdcca6501041f3": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
"expiration": 1613692796708677593
},
"8dc3258f4ba5b40648c2917da1a711581f388d88fddfc46c": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
@ -404,6 +499,11 @@
"tokens": null,
"expiration": 1613526336803063121
},
"9415a72cc9f5416dae7dea482e44729df6faf81203ea07d4": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
"expiration": 1613694260717883159
},
"961077032ebb89103c4e200be0e7517242cbfd0cbb989afc": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
@ -414,6 +514,11 @@
"tokens": null,
"expiration": 1613520871647468457
},
"98e5de0d483f3f5d2ae25f8479ae78ae4c4acb77247769ec": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
"expiration": 1613696926327240659
},
"9d382dfa406c01501fc5cc88b025c22d09248834da7e2b8b": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
@ -449,6 +554,11 @@
"tokens": null,
"expiration": 1613527553683560802
},
"a93d51e0c61e45954744bb9e567e1a2e3adf66d6f523bfdc": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
"expiration": 1613697245890826574
},
"aa9951b3b6533deadac0376a66a51e63ff6b9c306c82f4c8": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
@ -459,6 +569,11 @@
"tokens": null,
"expiration": 1613529105851594272
},
"aeb3741344eb316aeadb56b74ca8bb6b231ec65813b28a97": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
"expiration": 1613693018238355548
},
"b03c0a0ffd4568804db70522319c1958aed2f46af39d1b5c": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
@ -469,11 +584,21 @@
"tokens": null,
"expiration": 1613502660685792657
},
"b50e6818199b7570676580eff73ffa346c4896c9bd9305f0": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
"expiration": 1613693718301651019
},
"b68ba2f95b38fcef5ccb7307406eef6e68b49ec779240e8d": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
"expiration": 1613683356092862862
},
"b6edd4e9fe74461c523cbe200db0fec1b482a4519a0fc75c": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
"expiration": 1613693161977188987
},
"b796ead30cc71b1a7dc3865f5271f00061a7c81bf7805f5a": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
@ -484,6 +609,16 @@
"tokens": null,
"expiration": 1613691101882965054
},
"b964c2f2f93c50c371506e580d133dd3d47d04f5dc7e94f8": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
"expiration": 1613693719704975163
},
"be6101bcba1fe4f99bc3b1b2f650e659b56d7b29ed028902": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
"expiration": 1613691678486384988
},
"c053cc843cd5a58b6e7e4dfb0b896180734df58c6cf6ca88": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
@ -524,6 +659,11 @@
"tokens": null,
"expiration": 1613513847101926534
},
"ca9f2fe1d2d8a307253b185e073efd437f9f4c9980093f7c": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
"expiration": 1613693268070234462
},
"cd761cc3f15466f29eb789f5909bf26757d15661710e778c": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
@ -544,6 +684,11 @@
"tokens": null,
"expiration": 1613690972875693176
},
"d64186f2514b44277546563171a1ab7109f1fd7016724f0f": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
"expiration": 1613694259431652776
},
"d67b4bf0a826d445959290e5de933409b06a6f593b0c665c": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
@ -569,6 +714,11 @@
"tokens": null,
"expiration": 1613514516062495823
},
"e089dfbed493744e24c0cdf9be5f06c81979a17e166d098c": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
"expiration": 1613695253451697577
},
"e32e2c906864ae8cd98a474a918c9e1c9cbe64b1acf3e975": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
@ -619,6 +769,11 @@
"tokens": null,
"expiration": 1613522175097030333
},
"f5495743ebbb224a6d212b84473c2ed92721f113b9c005ff": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
"expiration": 1613694774594671280
},
"f5dd3851137b73d1e039ffa521d0c02e60504aa1f972fe13": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
@ -629,6 +784,21 @@
"tokens": null,
"expiration": 1613525903142014501
},
"f9a0201abaa6d9be524db280a664ded3b788753744cac1a3": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
"expiration": 1613694637844188675
},
"fac40abbc26627be007290d09f2bf060ddfa60f9b3c31cf3": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
"expiration": 1613696832158347108
},
"fcef70746e53856028c122514ee353a7d7ee393f59f9e2e3": {
"user": "uqnzie01i1nypnt9",
"tokens": null,
"expiration": 1613694775895766029
},
"fdbeb275182730c03ee00fc84da57dc080e60fb9d1dc587e": {
"user": "uqnzie01i1nypnt9",
"tokens": null,

View File

@ -3,7 +3,7 @@ UID: pqnzigq351j2fqgn
Type: image
Title: A really great photo!
TitleSrc: manual
Description: 'Sample App Description: 2021-02-11 15:31:40.812509789 -0800 PST m=+1.281183587'
Description: 'Sample App Description: 2021-02-11 17:16:03.257337568 -0800 PST m=+6.449998955'
DescriptionSrc: manual
OriginalName: IMG_3044
Year: -1
@ -13,5 +13,5 @@ Details:
Keywords: green, tambourine
KeywordsSrc: manual
CreatedAt: 2021-02-04T03:17:14.613092062Z
UpdatedAt: 2021-02-11T23:31:40.821110735Z
EditedAt: 2021-02-11T23:31:41Z
UpdatedAt: 2021-02-12T01:16:03.266957884Z
EditedAt: 2021-02-12T01:16:03Z

View File

@ -93,9 +93,160 @@ func TestHappyCreateUpdateDeleteAlbum(t *testing.T) {
}
// LikeAlbum
// DislikeAlbum
// TestHappyLikeDislikeAlbum
func TestHappyLikeDislikeAlbum(t *testing.T) {
album := api.Album{
AlbumTitle: WellKnownAlbumTitle,
}
newAlbum, err := Client.V1().CreateAlbum(album)
if err != nil {
t.Errorf("expected success creating album: %v", err)
t.FailNow()
}
err = Client.V1().LikeAlbum(newAlbum.AlbumUID)
if err != nil {
t.Errorf("expected to like album: %v", err)
// Note: We do NOT FailNow() here because we want to clean up
}
err = Client.V1().DislikeAlbum(newAlbum.AlbumUID)
if err != nil {
t.Errorf("expected to unlike album: %v", err)
// Note: We do NOT FailNow() here because we want to clean up
}
err = Client.V1().DeleteAlbums([]string{newAlbum.AlbumUID})
if err != nil {
t.Errorf("expected delete album %s, album not deleted: %v", newAlbum.AlbumUID, err)
t.FailNow()
}
}
// TestHappyLikeDislikeAlbum
func TestSadLikeDislikeAlbum(t *testing.T) {
err := Client.V1().LikeAlbum(UnknownAlbumID)
if err == nil {
t.Errorf("expected to error during unknown like album: %v", err)
t.FailNow()
}
err = Client.V1().DislikeAlbum(UnknownAlbumID)
if err == nil {
t.Errorf("expected to error during unknown dislike album: %v", err)
t.FailNow()
}
}
// CloneAlbums
// TestHappyLikeDislikeAlbum
func TestHappyCloneAlbum(t *testing.T) {
album := api.Album{
AlbumTitle: WellKnownAlbumTitle,
}
newAlbum, err := Client.V1().CreateAlbum(album)
if err != nil {
t.Errorf("expected success creating album: %v", err)
t.FailNow()
}
clonedAlbum, err := Client.V1().CloneAlbum(newAlbum)
if err != nil {
t.Errorf("expected to like album: %v", err)
// Note: We do NOT FailNow() here because we want to clean up
}
err = Client.V1().DeleteAlbums([]string{newAlbum.AlbumUID, clonedAlbum.AlbumUID})
if err != nil {
t.Errorf("expected delete album %s, album not deleted: %v", newAlbum.AlbumUID, err)
t.FailNow()
}
}
// TestSadCloneAlbum
func TestSadCloneAlbum(t *testing.T) {
album := api.Album{
AlbumUID: UnknownAlbumID,
}
_, err := Client.V1().CloneAlbum(album)
if err == nil {
t.Errorf("expected to error during unknown clone album: %v", err)
t.FailNow()
}
}
// TestAlbumAddDeletePhoto is a giant integration test
// that will exercise many methods in the SDK
//func TestAlbumAddDeletePhoto(t *testing.T) {
// album := api.Album{
// AlbumTitle: WellKnownAlbumTitle,
// }
//
// newAlbum, err := Client.V1().CreateAlbum(album)
// if err != nil {
// t.Errorf("expected success creating album: %v", err)
// t.FailNow()
// }
//
// // Add Photos
// photos := []string{
// WellKnownPhotoID,
// }
// err = Client.V1().AddPhotosToAlbum(newAlbum.AlbumUID, photos)
// if err != nil {
// t.Errorf("expected to add photos to album: %v", err)
// // Note: We do NOT FailNow() here because we want to clean up
// }
//
// // Get the photos by album
// updatedPhotos, err := Client.V1().GetPhotos(&api.PhotoOptions{
// Count: 100,
// AlbumUID: newAlbum.AlbumUID,
// })
// if err != nil {
// t.Errorf("expecting to list photos by album: %v", err)
// // Note: We do NOT FailNow() here because we want to clean up
// }
//
// var updatedPhotoIDs []string
// for _, photo := range updatedPhotos {
// updatedPhotoIDs = append(updatedPhotoIDs, photo.PhotoUID)
// }
// if len(updatedPhotos) != 1 {
// t.Errorf("expecting 1 well known photo in album, found: %d", len(updatedPhotos))
// }
//
// err = Client.V1().DeletePhotosFromAlbum(newAlbum.AlbumUID, updatedPhotoIDs)
// if err != nil {
// t.Errorf("expected to delete newly created photos from album: %v", err)
// // Note: We do NOT FailNow() here because we want to clean up
// }
//
// // Get the photos by album
// updatedPhotos, err = Client.V1().GetPhotos(&api.PhotoOptions{
// Count: 100,
// AlbumUID: newAlbum.AlbumUID,
// })
// if err != nil {
// t.Errorf("expecting to list photos by album: %v", err)
// // Note: We do NOT FailNow() here because we want to clean up
// }
//
// if len(updatedPhotos) != 0 {
// t.Errorf("expected empty album, found %d photos", len(updatedPhotos))
// // Note: We do NOT FailNow() here because we want to clean up
// }
//
// err = Client.V1().DeleteAlbums([]string{newAlbum.AlbumUID})
// if err != nil {
// t.Errorf("expected delete album %s, album not deleted: %v", newAlbum.AlbumUID, err)
// t.FailNow()
// }
//}
// AddPhotosToAlbum
// DeletePhotosFromAlbum
// GetAlbumDownload

10
test/index_test.go 100644
View File

@ -0,0 +1,10 @@
package test
import "testing"
func TestHappyIndex(t *testing.T) {
err := Client.V1().Index()
if err != nil {
t.Errorf("failed indexing: %v", err)
}
}

View File

@ -5,8 +5,23 @@ import (
"path"
"testing"
"time"
"github.com/kris-nova/client-go/api/v1"
)
//TODO Test GetPhotos()
func TestHappyGetPhotos(t *testing.T) {
_, err := Client.V1().GetPhotos(&api.PhotoOptions{
Count: 1,
AlbumUID: WellKnownAlbumID,
})
if err != nil {
t.Errorf("expected success getting well known photo: %v", err)
t.FailNow()
}
}
func TestHappyGetPhoto(t *testing.T) {
_, err := Client.V1().GetPhoto(WellKnownPhotoID)
if err != nil {