d91ef1832b
Function Test Coverage * test * scripts
20 lines
451 B
Go
20 lines
451 B
Go
package test
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
"github.com/testcontainers/testcontainers-go"
|
|
"github.com/testcontainers/testcontainers-go/network"
|
|
)
|
|
|
|
func CreateNetwork(t testing.TB, ctx context.Context) (*testcontainers.DockerNetwork, func()) {
|
|
network, err := network.New(ctx, network.WithDriver("bridge"))
|
|
require.NoError(t, err)
|
|
|
|
return network, func() {
|
|
testcontainers.CleanupNetwork(t, network)
|
|
}
|
|
}
|