Files
rclone/backend/overview/overview_test.go
T
dougalandNick Craig-Wood c4d87bd6d4 fs/config: add tier to config wizard
This makes the overview from the docs accessible in the code.
2026-07-14 14:16:19 +01:00

56 lines
1.3 KiB
Go

package overview
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestGetBackendConfig(t *testing.T) {
// s3 tier test
conf, err := GetBackendConfig("S3")
require.NoError(t, err, "failed to load s3.yaml")
require.NotNil(t, conf, "config should not be nil")
assert.Equal(t, "Tier 1", conf.Tier, "s3 should be tier 1")
// memory backend (unlikely to change)
conf, err = GetBackendConfig("memory")
require.NoError(t, err, "failed to load s3.yaml")
require.NotNil(t, conf, "config should not be nil")
expectedMemoryConfig := &BackendConfig{
Backend: "memory",
Name: "Memory",
Tier: "Tier 1",
Maintainers: "Core",
FeaturesScore: 4,
IntegrationTests: "Passing",
DataIntegrity: "Hash",
Performance: "High",
Adoption: "Widely used",
Docs: "Full",
Security: "High",
Virtual: false,
Remote: ":memory:",
Features: []string{
"BucketBased",
"BucketBasedRootOK",
"Copy",
"ListP",
"ListR",
"PutStream",
"ReadMimeType",
"WriteMimeType",
},
Hashes: []string{
"md5",
},
Precision: 1,
}
assert.Equal(t, expectedMemoryConfig, conf, "parsed memory.yaml should match")
}