restic/internal/backend/frostfs/config_test.go
Aleksey Kravchenko ca638bd459 [#1] Add frostfs backend
Signed-off-by: Aleksey Kravchenko <al.kravchenko@yadro.com>
2024-12-17 11:06:26 +03:00

28 lines
594 B
Go

package frostfs
import "testing"
func TestParseConfig(t *testing.T) {
for i, test := range []struct {
s string
cfg Config
}{
{"frostfs:grpcs://s01.frostfs.devenv:8080/container-name", Config{
Endpoint: "grpcs://s01.frostfs.devenv:8080",
Container: "container-name",
Connections: 5,
}},
} {
cfg, err := ParseConfig(test.s)
if err != nil {
t.Errorf("test %d:%s failed: %v", i, test.s, err)
continue
}
if *cfg != test.cfg {
t.Errorf("test %d:\ninput:\n %s\n wrong config, want:\n %v\ngot:\n %v",
i, test.s, test.cfg, cfg)
continue
}
}
}