Skip to content

Commit 55c1b41

Browse files
author
aviau
committed
Added test for alter_database_admin
1 parent 2dcf15b commit 55c1b41

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/influxdb/client_test.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,26 @@ def test_set_database_admin(self):
307307
def test_unset_database_admin(self):
308308
pass
309309

310+
def test_alter_database_admin(self):
311+
with requests_mock.Mocker() as m:
312+
m.register_uri(
313+
requests_mock.POST,
314+
"http://localhost:8086/db/db/users/paul"
315+
)
316+
317+
cli = InfluxDBClient(database='db')
318+
cli.alter_database_admin(
319+
username='paul',
320+
is_admin=False
321+
)
322+
323+
self.assertDictEqual(
324+
json.loads(m.last_request.body),
325+
{
326+
'admin': False
327+
}
328+
)
329+
310330
@raises(NotImplementedError)
311331
def test_get_list_database_admins(self):
312332
cli = InfluxDBClient('host', 8086, 'username', 'password', 'db')

0 commit comments

Comments
 (0)