mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-16 12:58:00 +00:00
36 lines
1.0 KiB
Go
36 lines
1.0 KiB
Go
|
package clean
|
||
|
|
||
|
import (
|
||
|
"github.com/stretchr/testify/assert"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func TestClean_Command1(t *testing.T) {
|
||
|
databases := []string{}
|
||
|
|
||
|
cmd := getCommand(databases)
|
||
|
equals := "/scripts/clean-migration.sh " + certPath
|
||
|
|
||
|
assert.Equal(t, equals, cmd)
|
||
|
}
|
||
|
|
||
|
func TestClean_Command2(t *testing.T) {
|
||
|
databases := []string{"test"}
|
||
|
|
||
|
cmd := getCommand(databases)
|
||
|
equals := "/scripts/clean-db.sh " + certPath + " test && /scripts/clean-user.sh " + certPath + " test && /scripts/clean-migration.sh " + certPath
|
||
|
|
||
|
assert.Equal(t, equals, cmd)
|
||
|
}
|
||
|
|
||
|
func TestClean_Command3(t *testing.T) {
|
||
|
databases := []string{"test1", "test2", "test3"}
|
||
|
|
||
|
cmd := getCommand(databases)
|
||
|
equals := "/scripts/clean-db.sh " + certPath + " test1 && /scripts/clean-db.sh " + certPath + " test2 && /scripts/clean-db.sh " + certPath + " test3 && " +
|
||
|
"/scripts/clean-user.sh " + certPath + " test1 && /scripts/clean-user.sh " + certPath + " test2 && /scripts/clean-user.sh " + certPath + " test3 && " +
|
||
|
"/scripts/clean-migration.sh " + certPath
|
||
|
|
||
|
assert.Equal(t, equals, cmd)
|
||
|
}
|