Total Lines | 41 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | package solr |
||
2 | |||
3 | import ( |
||
4 | "context" |
||
5 | "testing" |
||
6 | ) |
||
7 | |||
8 | func TestUploadConfig(t *testing.T) { |
||
9 | client := NewClient() |
||
10 | _, err := client.Config.Upload(context.Background(), "../example/configs/identify-events.zip", "identify-events") |
||
11 | if err != nil { |
||
12 | t.Errorf("failed to upload config %v", err) |
||
13 | } |
||
14 | } |
||
15 | |||
16 | func TestCreateConfig(t *testing.T) { |
||
17 | client := NewClient() |
||
18 | _, err := client.Config.Create(context.Background(), CreateConfig{ |
||
19 | Create: Config{ |
||
20 | Name: "identify-events.CREATE", |
||
21 | BaseConfigSet: "identify-events", |
||
22 | }, |
||
23 | }) |
||
24 | if err != nil { |
||
25 | t.Errorf("failed to create config %v", err) |
||
26 | } |
||
27 | } |
||
28 | |||
29 | func TestDeleteConfig1(t *testing.T) { |
||
30 | client := NewClient() |
||
31 | _, err := client.Config.Delete(context.Background(), "identify-events.CREATE") |
||
32 | if err != nil { |
||
33 | t.Errorf("failed to delete config %v", err) |
||
34 | } |
||
35 | } |
||
36 | |||
37 | func TestDeleteConfig2(t *testing.T) { |
||
38 | client := NewClient() |
||
39 | _, err := client.Config.Delete(context.Background(), "identify-events") |
||
40 | if err != nil { |
||
41 | t.Errorf("failed to delete config %v", err) |
||
42 | } |
||
44 |