Skip to content

Commit 53a3d33

Browse files
author
aviau
committed
Fixed spelling mistakes + newline + relative import
1 parent b00409a commit 53a3d33

File tree

3 files changed

+16
-18
lines changed

3 files changed

+16
-18
lines changed

tests/influxdb/client_test_with_server.py

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@
2828
from influxdb import InfluxDBClient
2929
from influxdb.client import InfluxDBClientError
3030

31-
from .misc import get_free_port, is_port_open
31+
from tests.influxdb.misc import get_free_port, is_port_open
3232

3333

3434
THIS_DIR = os.path.abspath(os.path.dirname(__file__))
3535

3636

37-
# try to find where is located the 'influxd' binary:
37+
# try to find where the 'influxd' binary is located:
3838
# You can define 'InfluxDbPythonClientTest_SERVER_BIN_PATH'
3939
# env var to force it :
4040
influxdb_bin_path = influxdb_forced_bin = os.environ.get(
@@ -65,7 +65,7 @@
6565
print(version, file=sys.stderr)
6666

6767

68-
dummy_point = [ # some dummy points .. :o
68+
dummy_point = [ # some dummy points
6969
{
7070
"name": "cpu_load_short",
7171
"tags": {
@@ -79,7 +79,7 @@
7979
}
8080
]
8181

82-
dummy_points = [ # some dummy points .. :o
82+
dummy_points = [ # some dummy points
8383
dummy_point[0],
8484
{
8585
"name": "memory",
@@ -111,7 +111,7 @@
111111
class InfluxDbInstance(object):
112112

113113
def __init__(self, conf_template):
114-
# create a fresh temporary place for storing all needed files
114+
# create a temporary dir to store all needed files
115115
# for the influxdb server instance :
116116
self.temp_dir_base = tempfile.mkdtemp()
117117
# "temp_dir_base" will be used for conf file and logs,
@@ -121,7 +121,7 @@ def __init__(self, conf_template):
121121
# we need some "free" ports :
122122
self.broker_port = get_free_port()
123123
self.admin_port = get_free_port()
124-
# as it's UDP we can reuse the same port than the broker:
124+
# as it's UDP we can reuse the same port as the broker:
125125
self.udp_port = get_free_port()
126126

127127
self.logs_file = os.path.join(
@@ -157,8 +157,8 @@ def __init__(self, conf_template):
157157

158158
# wait for it to listen on the broker and admin ports:
159159
# usually a fresh instance is ready in less than 1 sec ..
160-
timeout = time.time() + 10 # so 10 secs should be rather enough,
161-
# otherwise either your system load is rather high,
160+
timeout = time.time() + 10 # so 10 secs should be enough,
161+
# otherwise either your system load is high,
162162
# or you run a 286 @ 1Mhz ?
163163
try:
164164
while time.time() < timeout:
@@ -200,7 +200,7 @@ def close(self, remove_tree=True):
200200

201201
class InfluxDbClientTestWithServerInstanceMixin(object):
202202
''' A mixin for unittest.TestCase to start an influxdb server instance
203-
in a fresh temporary place.
203+
in a temporary directory.
204204
'''
205205

206206
# 'influxdb_template_conf' attribute must be set on the class or instance
@@ -219,7 +219,7 @@ def tearDown(self):
219219
self.influxd_inst.close(remove_tree=remove_tree)
220220

221221

222-
@unittest.skipIf(not is_influxdb_bin_ok, "not found any influxd binary")
222+
@unittest.skipIf(not is_influxdb_bin_ok, "could not find influxd binary")
223223
class TestInfluxDBClient(InfluxDbClientTestWithServerInstanceMixin,
224224
unittest.TestCase):
225225

@@ -479,7 +479,7 @@ def test_create_retention_policy(self):
479479
)
480480

481481

482-
@unittest.skipIf(not is_influxdb_bin_ok, "not found any influxd binary")
482+
@unittest.skipIf(not is_influxdb_bin_ok, "could not find influxd binary")
483483
class UdpTests(InfluxDbClientTestWithServerInstanceMixin,
484484
unittest.TestCase):
485485

@@ -497,11 +497,9 @@ def test_write_points_udp(self):
497497
cli.create_database('db')
498498
cli.write_points(dummy_point)
499499

500-
# ho boy,
501-
# once write_points finishes then the points aren't actually
502-
# already directly available !!
503-
# Well, it's normal because we sent by udp (no response !).
504-
# So we have to wait some enough time,
500+
# The points are not immediately available after write_points.
501+
# This is to be expected because we are using udp (no response !).
502+
# So we have to wait some time,
505503
time.sleep(1) # 1 sec seems to be a good choice.
506504
rsp = cli.query('SELECT * FROM cpu_load_short')
507505

tests/influxdb/influxdb.conf.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,4 @@ raft-tracing = false # If true, enables detailed logging of Raft consensus.
9696
enabled = false
9797
database = "internal" # The database to which the data is written.
9898
retention-policy = "default" # The retention policy within the database.
99-
write-interval = "1m" # Period between writing the data.
99+
write-interval = "1m" # Period between writing the data.

tests/influxdb/influxdb.udp_conf.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,4 @@ raft-tracing = false # If true, enables detailed logging of Raft consensus.
9696
enabled = false
9797
database = "internal" # The database to which the data is written.
9898
retention-policy = "default" # The retention policy within the database.
99-
write-interval = "1m" # Period between writing the data.
99+
write-interval = "1m" # Period between writing the data.

0 commit comments

Comments
 (0)