2017-07-08 13:34:23 +00:00
|
|
|
package gs
|
|
|
|
|
2023-04-20 21:02:56 +00:00
|
|
|
import (
|
|
|
|
"testing"
|
2017-07-08 13:34:23 +00:00
|
|
|
|
2023-04-20 21:02:56 +00:00
|
|
|
"github.com/restic/restic/internal/backend/test"
|
|
|
|
)
|
|
|
|
|
|
|
|
var configTests = []test.ConfigTestData[Config]{
|
2023-04-21 19:11:33 +00:00
|
|
|
{S: "gs:bucketname:/", Cfg: Config{
|
2017-07-08 13:34:23 +00:00
|
|
|
Bucket: "bucketname",
|
|
|
|
Prefix: "",
|
|
|
|
Connections: 5,
|
2023-02-27 06:53:25 +00:00
|
|
|
Region: "us",
|
2017-07-08 13:34:23 +00:00
|
|
|
}},
|
2023-04-21 19:11:33 +00:00
|
|
|
{S: "gs:bucketname:/prefix/directory", Cfg: Config{
|
2017-07-08 13:34:23 +00:00
|
|
|
Bucket: "bucketname",
|
|
|
|
Prefix: "prefix/directory",
|
|
|
|
Connections: 5,
|
2023-02-27 06:53:25 +00:00
|
|
|
Region: "us",
|
2017-07-08 13:34:23 +00:00
|
|
|
}},
|
2023-04-21 19:11:33 +00:00
|
|
|
{S: "gs:bucketname:/prefix/directory/", Cfg: Config{
|
2017-07-08 13:34:23 +00:00
|
|
|
Bucket: "bucketname",
|
|
|
|
Prefix: "prefix/directory",
|
|
|
|
Connections: 5,
|
2023-02-27 06:53:25 +00:00
|
|
|
Region: "us",
|
2017-07-08 13:34:23 +00:00
|
|
|
}},
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestParseConfig(t *testing.T) {
|
2023-04-20 21:02:56 +00:00
|
|
|
test.ParseConfigTester(t, ParseConfig, configTests)
|
2017-07-08 13:34:23 +00:00
|
|
|
}
|