Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
notfelineit committed Apr 24, 2024
1 parent e0cb3eb commit 7998e43
Showing 1 changed file with 23 additions and 19 deletions.
42 changes: 23 additions & 19 deletions cmd/internal/planetscale_connection_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package internal

import (
"testing"

psdbconnect "github.com/planetscale/airbyte-source/proto/psdbconnect/v1alpha1"
"github.com/stretchr/testify/assert"
"testing"
)

func TestCanGenerateSecureDSN(t *testing.T) {
Expand Down Expand Up @@ -49,12 +50,13 @@ func TestCanGenerateInitialState_Sharded(t *testing.T) {
}

for _, shard := range shards {
expectedShardStates.Shards[shard], err = TableCursorToSerializedCursor(&psdbconnect.TableCursor{
Shard: shard,
Keyspace: "connect-test",
Position: "",
})
assert.NoError(t, err)
expectedShardStates.Shards[shard] = &SerializedCursor{
Cursor: &psdbconnect.TableCursor{
Shard: shard,
Keyspace: "connect-test",
Position: "",
},
}
}

assert.NoError(t, err)
Expand Down Expand Up @@ -86,12 +88,13 @@ func TestCanGenerateInitialState_CustomShards(t *testing.T) {
}

for _, shard := range configuredShards {
expectedShardStates.Shards[shard], err = TableCursorToSerializedCursor(&psdbconnect.TableCursor{
Shard: shard,
Keyspace: "connect-test",
Position: "",
})
assert.NoError(t, err)
expectedShardStates.Shards[shard] = &SerializedCursor{
Cursor: &psdbconnect.TableCursor{
Shard: shard,
Keyspace: "connect-test",
Position: "",
},
}
}

assert.NoError(t, err)
Expand All @@ -116,12 +119,13 @@ func TestCanGenerateInitialState_Unsharded(t *testing.T) {
}

for _, shard := range shards {
expectedShardStates.Shards[shard], err = TableCursorToSerializedCursor(&psdbconnect.TableCursor{
Shard: shard,
Keyspace: "connect-test",
Position: "",
})
assert.NoError(t, err)
expectedShardStates.Shards[shard] = &SerializedCursor{
Cursor: &psdbconnect.TableCursor{
Shard: shard,
Keyspace: "connect-test",
Position: "",
},
}
}

assert.NoError(t, err)
Expand Down

0 comments on commit 7998e43

Please sign in to comment.