Merged in feature/preserve-folder-paths (pull request #179)

support folder paths

* support folder paths

* s3 storage docs
This commit is contained in:
Jay Brown
2025-09-05 18:25:31 +00:00
parent 0ad41de26b
commit 730f3ba11a
27 changed files with 8281 additions and 63 deletions
+10 -9
View File
@@ -52,7 +52,7 @@ func TestCreate(t *testing.T) {
pgxmock.NewRows([]string{"id"}),
)
pool.ExpectBegin()
pool.ExpectQuery("name: CreateDocument :one").WithArgs(doc.ClientID, doc.Hash, (*uuid.UUID)(nil)).
pool.ExpectQuery("name: CreateDocument :one").WithArgs(doc.ClientID, doc.Hash, (*uuid.UUID)(nil), (*string)(nil)).
WillReturnRows(
pgxmock.NewRows([]string{"id"}).
AddRow(doc.ID),
@@ -80,14 +80,14 @@ func TestCreate(t *testing.T) {
mock.MatchedBy(func(in *sqs.SendMessageInput) bool {
return *in.QueueUrl == cfg.DocumentSyncURL && *in.MessageBody == fmt.Sprintf("{\"id\":\"%s\"}", doc.ID.String())
}),
mock.Anything,
).
Return(&sqs.SendMessageOutput{}, nil)
id, err := svc.Create(ctx, &Create{
Hash: doc.Hash,
Key: key,
Bucket: bucket,
Hash: doc.Hash,
Key: key,
Bucket: bucket,
Filename: nil, // No filename for this test
})
require.NoError(t, err)
assert.Equal(t, doc.ID, id)
@@ -235,7 +235,7 @@ func TestSubmitCreate(t *testing.T) {
}
pool.ExpectBegin()
pool.ExpectQuery("name: CreateDocument :one").WithArgs(doc.ClientID, doc.Hash, (*uuid.UUID)(nil)).
pool.ExpectQuery("name: CreateDocument :one").WithArgs(doc.ClientID, doc.Hash, (*uuid.UUID)(nil), (*string)(nil)).
WillReturnRows(
pgxmock.NewRows([]string{"id"}).
AddRow(doc.ID),
@@ -245,9 +245,10 @@ func TestSubmitCreate(t *testing.T) {
pool.ExpectCommit()
id, err := svc.submitCreate(ctx, &createDocumentParams{
Hash: doc.Hash,
Bucket: bucket,
Key: key,
Hash: doc.Hash,
Bucket: bucket,
Key: key,
Filename: nil, // No filename for this test
})
require.NoError(t, err)
assert.Equal(t, doc.ID, id)