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