Merged in feature/docresult (pull request #105)
Document Result Endpoint * testing * cleantesting * progress * query * lint * readme * dockerclient * api * passtest * tests * test
This commit is contained in:
@@ -90,7 +90,7 @@ func (s *Service) clean(ctx context.Context, id uuid.UUID) error {
|
||||
slog.Debug("cleaning document", "id", id.String())
|
||||
docId := database.MustToDBUUID(id)
|
||||
|
||||
doc, err := s.cfg.GetDBQueries().GetDocument(ctx, docId)
|
||||
doc, err := s.cfg.GetDBQueries().GetDocumentSummary(ctx, docId)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ func TestClean(t *testing.T) {
|
||||
cfg: cfg,
|
||||
}
|
||||
|
||||
doc := document.Document{
|
||||
doc := document.DocumentSummary{
|
||||
ID: uuid.New(),
|
||||
ClientID: uuid.New(),
|
||||
Hash: "example_hash",
|
||||
@@ -46,7 +46,7 @@ func TestClean(t *testing.T) {
|
||||
}
|
||||
dbid := database.MustToDBUUID(doc.ID)
|
||||
|
||||
pool.ExpectQuery("name: GetDocument :one").WithArgs(dbid).
|
||||
pool.ExpectQuery("name: GetDocumentSummary :one").WithArgs(dbid).
|
||||
WillReturnRows(
|
||||
pgxmock.NewRows([]string{"id", "clientId", "hash"}).
|
||||
AddRow(dbid, database.MustToDBUUID(doc.ClientID), doc.Hash),
|
||||
@@ -173,7 +173,7 @@ func TestStoreClean(t *testing.T) {
|
||||
cfg: cfg,
|
||||
}
|
||||
|
||||
doc := document.Document{
|
||||
doc := document.DocumentSummary{
|
||||
ID: uuid.New(),
|
||||
}
|
||||
inloc := document.Location{
|
||||
|
||||
@@ -50,7 +50,7 @@ func TestCreate(t *testing.T) {
|
||||
cfg: cfg,
|
||||
}
|
||||
|
||||
doc := document.Document{
|
||||
doc := document.DocumentSummary{
|
||||
ID: uuid.New(),
|
||||
ClientID: uuid.New(),
|
||||
Hash: "example_hash",
|
||||
@@ -65,7 +65,7 @@ func TestCreate(t *testing.T) {
|
||||
pgxmock.NewRows([]string{"isclean"}).
|
||||
AddRow(false),
|
||||
)
|
||||
pool.ExpectQuery("name: GetDocument :one").WithArgs(dbid).
|
||||
pool.ExpectQuery("name: GetDocumentSummary :one").WithArgs(dbid).
|
||||
WillReturnRows(
|
||||
pgxmock.NewRows([]string{"id", "clientId", "hash"}).
|
||||
AddRow(dbid, database.MustToDBUUID(doc.ClientID), doc.Hash),
|
||||
|
||||
Reference in New Issue
Block a user