8000 Added test_write_points_string (see #80) · TragerTech/influxdb-python@6a4d2dd · GitHub
[go: up one dir, main page]

Skip to content

Commit 6a4d2dd

Browse files
author
aviau
committed
Added test_write_points_string (see influxdata#80)
1 parent 9b16856 commit 6a4d2dd

File tree

Original file line numberDiff line numberDiff line change
@@ -109,6 +109,23 @@ def test_write_points(self):
109109
self.dummy_points
110110
)
111111

112+
def test_write_points_string(self):
113+
with requests_mock.Mocker() as m:
114+
m.register_uri(
115+
requests_mock.POST,
116+
"http://localhost:8086/db/db/series"
117+
)
118+
119+
cli = InfluxDBClient(database='db')
120+
cli.write_points(
121+
str(json.dumps(self.dummy_points))
122+
)
123+
124+
self.assertListEqual(
125+
json.loads(m.last_request.body),
126+
self.dummy_points
127+
)
128+
112129
def test_write_points_batch(self):
113130
with _mocked_session('post', 200, self.dummy_points):
114131
cli = InfluxDBClient('host', 8086, 'username', 'password', 'db')