terraform-module-test-helper/retryable_errors_test.go

20 строки
490 B
Go
Исходник Обычный вид История

package terraform_module_test_helper
import (
"github.com/stretchr/testify/require"
2022-11-16 12:49:41 +03:00
"os"
"testing"
2023-01-19 10:22:18 +03:00
"github.com/stretchr/testify/assert"
)
func TestLoadRetryableErrors(t *testing.T) {
cfg, err := os.ReadFile("retryable_errors_sample.hcl.json")
require.NoError(t, err)
retryableErrors := ReadRetryableErrors(cfg, t)
assert.Equal(t, 1, len(retryableErrors))
desc, ok := retryableErrors["GatewayTimeout"]
assert.True(t, ok)
assert.Equal(t, "retryable errors set by test", desc)
}