Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

Commit 39d3b3f

Browse files
Add docstrings of test cases.
1 parent 0bae68b commit 39d3b3f

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

influxdb/tests/client_test.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,6 +1028,9 @@ def test_get_list_privileges_fails(self):
10281028
cli.get_list_privileges('test')
10291029

10301030
def test_get_list_continuous_queries(self):
1031+
"""
1032+
Test getting a list of continuous queries by TestInfluxDBClient object.
1033+
"""
10311034
data = {
10321035
"results": [
10331036
{
@@ -1076,10 +1079,17 @@ def test_get_list_continuous_queries(self):
10761079

10771080
@raises(Exception)
10781081
def test_get_list_continuous_queries_fails(self):
1082+
"""
1083+
Test failing to get a list of continuous queries by TestInfluxDBClient
1084+
object.
1085+
"""
10791086
with _mocked_session(self.cli, 'get', 400):
10801087
self.cli.get_list_continuous_queries()
10811088

10821089
def test_create_continuous_query(self):
1090+
"""
1091+
Test continuous query creation with TestInfluxDBClient object.
1092+
"""
10831093
data = {"results": [{}]}
10841094
with requests_mock.Mocker() as m:
10851095
m.register_uri(
@@ -1107,10 +1117,16 @@ def test_create_continuous_query(self):
11071117

11081118
@raises(Exception)
11091119
def test_create_continuous_query_fails(self):
1120+
"""
1121+
Test failing to create a continuous query by TestInfluxDBClient object.
1122+
"""
11101123
with _mocked_session(self.cli, 'get', 400):
11111124
self.cli.create_continuous_query('cq_name', 'select', 'db_name')
11121125

11131126
def test_drop_continuous_query(self):
1127+
"""
1128+
Test dropping a continuous query by TestInfluxDBClient object.
1129+
"""
11141130
data = {"results": [{}]}
11151131
with requests_mock.Mocker() as m:
11161132
m.register_uri(
@@ -1126,6 +1142,9 @@ def test_drop_continuous_query(self):
11261142

11271143
@raises(Exception)
11281144
def test_drop_continuous_query_fails(self):
1145+
"""
1146+
Test failing to drop a continuous query by TestInfluxDBClient object.
1147+
"""
11291148
with _mocked_session(self.cli, 'get', 400):
11301149
self.cli.drop_continuous_query('cq_name', 'db_name')
11311150

influxdb/tests/server_tests/client_test_with_server.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,7 @@ def test_drop_retention_policy(self):
721721
)
722722

723723
def test_create_continuous_query(self):
724+
"""Test continuous query creation."""
724725
self.cli.create_retention_policy('some_rp', '1d', 1)
725726
query = 'select count("value") into "some_rp"."events" from ' \
726727
'"events" group by time(10m)'
@@ -742,6 +743,7 @@ def test_create_continuous_query(self):
742743
self.assertEqual(cqs, expected_cqs)
743744

744745
def test_drop_continuous_query(self):
746+
"""Test continuous query drop."""
745747
self.test_create_continuous_query()
746748
self.cli.drop_continuous_query('test_cq', 'db')
747749
cqs = self.cli.get_list_continuous_queries()

0 commit comments

Comments
 (0)