Skip to content
Snippets Groups Projects
Commit b9869ead authored by Cameron Sparr's avatar Cameron Sparr
Browse files

0.3.0 unit tests: influxdb

parent 936c5a8a
No related branches found
No related tags found
No related merge requests found
...@@ -72,29 +72,26 @@ func TestBasic(t *testing.T) { ...@@ -72,29 +72,26 @@ func TestBasic(t *testing.T) {
require.NoError(t, plugin.Gather(&acc)) require.NoError(t, plugin.Gather(&acc))
require.Len(t, acc.Points, 2) require.Len(t, acc.Points, 2)
require.NoError(t, acc.ValidateTaggedFieldsValue( fields := map[string]interface{}{
"foo", // JSON will truncate floats to integer representations.
map[string]interface{}{ // Since there's no distinction in JSON, we can't assume it's an int.
// JSON will truncate floats to integer representations. "i": -1.0,
// Since there's no distinction in JSON, we can't assume it's an int. "f": 0.5,
"i": -1.0, "b": true,
"f": 0.5, "s": "string",
"b": true, }
"s": "string", tags := map[string]string{
}, "id": "ex1",
map[string]string{ "url": fakeServer.URL + "/endpoint",
"id": "ex1", }
"url": fakeServer.URL + "/endpoint", acc.AssertContainsTaggedFields(t, "foo", fields, tags)
},
)) fields = map[string]interface{}{
require.NoError(t, acc.ValidateTaggedFieldsValue( "x": "x",
"bar", }
map[string]interface{}{ tags = map[string]string{
"x": "x", "id": "ex2",
}, "url": fakeServer.URL + "/endpoint",
map[string]string{ }
"id": "ex2", acc.AssertContainsTaggedFields(t, "bar", fields, tags)
"url": fakeServer.URL + "/endpoint",
},
))
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment