Add attachments field to one
This commit is contained in:
@@ -129,6 +129,9 @@ func TestBoltDBFind(t *testing.T) {
|
||||
if o.Modified == 0 {
|
||||
t.Error(o.Modified)
|
||||
}
|
||||
if len(o.Attachments) == 0 {
|
||||
t.Error(o.Attachments)
|
||||
}
|
||||
if len(o.Connections) == 0 {
|
||||
t.Error(o.Connections)
|
||||
}
|
||||
@@ -367,6 +370,12 @@ func fillBoltDB(t *testing.T, bdb *BoltDB) {
|
||||
return err
|
||||
}
|
||||
for i := 0; i < testN; i++ {
|
||||
p := entity.One{
|
||||
Name: "name-" + uuid.New().String()[:5],
|
||||
Type: "type-" + uuid.New().String()[:5],
|
||||
Relationship: "rshp-" + uuid.New().String()[:5],
|
||||
Title: "titl-" + uuid.New().String()[:5],
|
||||
}
|
||||
o := entity.One{
|
||||
Name: "name-" + uuid.New().String()[:5],
|
||||
Type: "type-" + uuid.New().String()[:5],
|
||||
@@ -374,15 +383,9 @@ func fillBoltDB(t *testing.T, bdb *BoltDB) {
|
||||
Image: "imge-" + uuid.New().String()[:5],
|
||||
Text: "text-" + uuid.New().String()[:5],
|
||||
Modified: time.Now().UnixNano(),
|
||||
Connections: map[string]entity.One{},
|
||||
Connections: map[string]entity.One{p.Name: p},
|
||||
Attachments: map[string]string{"filename": "/path/to/file"},
|
||||
}
|
||||
p := entity.One{
|
||||
Name: "name-" + uuid.New().String()[:5],
|
||||
Type: "type-" + uuid.New().String()[:5],
|
||||
Relationship: "rshp-" + uuid.New().String()[:5],
|
||||
Title: "titl-" + uuid.New().String()[:5],
|
||||
}
|
||||
o.Connections[p.Name] = p
|
||||
b, err := bson.Marshal(o)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user