Debian Codegraph @

snapshot_verify_repository_test.go

raw
1 // Copyright 2012-present Oliver Eilhard. All rights reserved.
2 // Use of this source code is governed by a MIT-license.
3 // See http://olivere.mit-license.org/license.txt for details.
4
5 package elastic
6
7 import "testing"
8
9 func TestSnapshotVerifyRepositoryURL(t *testing.T) {
10 client := setupTestClient(t)
11
12 tests := []struct {
13 Repository string
14 Expected string
15 }{
16 {
17 "repo",
18 "/_snapshot/repo/_verify",
19 },
20 }
21
22 for _, test := range tests {
23 path, _, err := client.SnapshotVerifyRepository(test.Repository).buildURL()
24 if err != nil {
25 t.Fatal(err)
26 }
27 if path != test.Expected {
28 t.Errorf("expected %q; got: %q", test.Expected, path)
29 }
30 }
31 }