mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Feat: Integration tests
This commit is contained in:
26
cli/test/helper.go
Normal file
26
cli/test/helper.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package tests
|
||||
|
||||
type Secret struct {
|
||||
Key string
|
||||
Value string
|
||||
}
|
||||
|
||||
func Map[T, U any](ts []T, f func(T) U) []U {
|
||||
us := make([]U, len(ts))
|
||||
for i := range ts {
|
||||
us[i] = f(ts[i])
|
||||
}
|
||||
return us
|
||||
}
|
||||
|
||||
func getSecretKeysAndValues(secrets []Secret) (keys []string, values []string) {
|
||||
secretKeys := []string{}
|
||||
secretValues := []string{}
|
||||
|
||||
for _, secret := range secrets {
|
||||
secretKeys = append(secretKeys, secret.Key)
|
||||
secretValues = append(secretValues, secret.Value)
|
||||
}
|
||||
|
||||
return secretKeys, secretValues
|
||||
}
|
||||
Reference in New Issue
Block a user