Skip to content

Commit

Permalink
Re-order test data with struct definition
Browse files Browse the repository at this point in the history
  • Loading branch information
otoolep committed Apr 30, 2015
1 parent dd93ce2 commit c3e6ea2
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions collectd/collectd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,39 +210,32 @@ func TestUnmarshal_Points(t *testing.T) {
}{
{
name: "single value",
points: []influxdb.Point{
{Name: "disk_read", Fields: map[string]interface{}{"disk_read": float64(1)}},
},
packet: gollectd.Packet{
Plugin: "disk",
Values: []gollectd.Value{
{Name: "read", Value: 1},
},
},
},
{
name: "multi value",
points: []influxdb.Point{
{Name: "disk_read", Fields: map[string]interface{}{"disk_read": float64(1)}},
{Name: "disk_write", Fields: map[string]interface{}{"disk_write": float64(5)}},
},
},
{
name: "multi value",
packet: gollectd.Packet{
Plugin: "disk",
Values: []gollectd.Value{
{Name: "read", Value: 1},
{Name: "write", Value: 5},
},
},
points: []influxdb.Point{
{Name: "disk_read", Fields: map[string]interface{}{"disk_read": float64(1)}},
{Name: "disk_write", Fields: map[string]interface{}{"disk_write": float64(5)}},
},
},
{
name: "tags",
points: []influxdb.Point{
{
Name: "disk_read",
Tags: map[string]string{"host": "server01", "instance": "sdk", "type": "disk_octets", "type_instance": "single"},
Fields: map[string]interface{}{"disk_read": float64(1)},
},
},
packet: gollectd.Packet{
Plugin: "disk",
Hostname: "server01",
Expand All @@ -253,6 +246,13 @@ func TestUnmarshal_Points(t *testing.T) {
{Name: "read", Value: 1},
},
},
points: []influxdb.Point{
{
Name: "disk_read",
Tags: map[string]string{"host": "server01", "instance": "sdk", "type": "disk_octets", "type_instance": "single"},
Fields: map[string]interface{}{"disk_read": float64(1)},
},
},
},
}

Expand Down

0 comments on commit c3e6ea2

Please sign in to comment.