Completed
Push — master ( ea2733...2ce5e0 )
by Adriano
17s queued 12s
created

solr.TestUploadConfig   A

Complexity

Conditions 2

Size

Total Lines 5
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 5
nop 1
dl 0
loc 5
rs 10
c 0
b 0
f 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
	}
43
}
44