mirror of
https://github.com/openziti/zrok.git
synced 2025-08-19 04:06:18 +02:00
29
controller/store/environment_test.go
Normal file
29
controller/store/environment_test.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package store
|
||||
|
||||
import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestEphemeralEnvironment(t *testing.T) {
|
||||
str, err := Open(&Config{Path: ":memory:", Type: "sqlite3"})
|
||||
assert.Nil(t, err)
|
||||
assert.NotNil(t, str)
|
||||
|
||||
tx, err := str.Begin()
|
||||
assert.Nil(t, err)
|
||||
assert.NotNil(t, tx)
|
||||
|
||||
envId, err := str.CreateEphemeralEnvironment(&Environment{
|
||||
Description: "description",
|
||||
Host: "host",
|
||||
Address: "address",
|
||||
ZId: "zId0",
|
||||
}, tx)
|
||||
assert.Nil(t, err)
|
||||
|
||||
env, err := str.GetEnvironment(envId, tx)
|
||||
assert.Nil(t, err)
|
||||
assert.NotNil(t, env)
|
||||
assert.Nil(t, env.AccountId)
|
||||
}
|
Reference in New Issue
Block a user