Skip to content

Commit

Permalink
add simple unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
matt2e committed Jul 16, 2024
1 parent f0829b8 commit 44ebf14
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions backend/controller/dal/async_calls_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package dal

import (
"context"
"testing"

"github.com/TBD54566975/ftl/backend/controller/sql/sqltest"
dalerrs "github.com/TBD54566975/ftl/backend/dal"
"github.com/TBD54566975/ftl/internal/log"
"github.com/alecthomas/assert/v2"
)

func TestNoCallToAcquire(t *testing.T) {
ctx := log.ContextWithNewDefaultLogger(context.Background())
conn := sqltest.OpenForTesting(ctx, t)
dal, err := New(ctx, conn)
assert.NoError(t, err)

_, err = dal.AcquireAsyncCall(ctx)
assert.IsError(t, err, dalerrs.ErrNotFound)
assert.EqualError(t, err, "no pending async calls: not found")
}

0 comments on commit 44ebf14

Please sign in to comment.