(t *testing.T)
| 586 | } |
| 587 | |
| 588 | func TestSetAttachment(t *testing.T) { |
| 589 | db, ctx := setupTestDB(t) |
| 590 | defer db.Close(ctx) |
| 591 | collection, ctx := GetSingleDatabaseCollectionWithUser(ctx, t, db) |
| 592 | |
| 593 | // Set attachment with a valid attachment |
| 594 | att := `{"att1.txt": {"data": "YXR0MS50eHQ="}}}` |
| 595 | key := Sha1DigestKey([]byte(att)) |
| 596 | err := collection.setAttachment(ctx, key, []byte(att)) |
| 597 | assert.NoError(t, err, "Attachment should be saved in db and key should be returned") |
| 598 | attBytes, err := collection.GetAttachment(key) |
| 599 | assert.NoError(t, err, "Attachment should be retrieved from the database") |
| 600 | assert.Equal(t, att, string(attBytes)) |
| 601 | } |
| 602 | |
| 603 | func TestRetrieveAncestorAttachments(t *testing.T) { |
| 604 | db, ctx := setupTestDBAllowConflicts(t) |
nothing calls this directly
no test coverage detected