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

Rename all mixedCase globals to snake case to appease N816 #689

Merged
merged 1 commit into from
Mar 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions influxdb/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
import unittest

using_pypy = hasattr(sys, "pypy_version_info")
skipIfPYpy = unittest.skipIf(using_pypy, "Skipping this test on pypy.")
skip_if_pypy = unittest.skipIf(using_pypy, "Skipping this test on pypy.")

_skip_server_tests = os.environ.get(
'INFLUXDB_PYTHON_SKIP_SERVER_TESTS',
None) == 'True'
skipServerTests = unittest.skipIf(_skip_server_tests,
"Skipping server tests...")
skip_server_tests = unittest.skipIf(_skip_server_tests,
"Skipping server tests...")
4 changes: 2 additions & 2 deletions influxdb/tests/dataframe_client_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import warnings
import requests_mock

from influxdb.tests import skipIfPYpy, using_pypy
from influxdb.tests import skip_if_pypy, using_pypy
from nose.tools import raises

from .client_test import _mocked_session
Expand All @@ -24,7 +24,7 @@
from influxdb import DataFrameClient


@skipIfPYpy
@skip_if_pypy
class TestDataFrameClient(unittest.TestCase):
"""Set up a test DataFrameClient object."""

Expand Down
4 changes: 2 additions & 2 deletions influxdb/tests/influxdb08/dataframe_client_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from nose.tools import raises

from influxdb.tests import skipIfPYpy, using_pypy
from influxdb.tests import skip_if_pypy, using_pypy

from .client_test import _mocked_session

Expand All @@ -22,7 +22,7 @@
from influxdb.influxdb08 import DataFrameClient


@skipIfPYpy
@skip_if_pypy
class TestDataFrameClient(unittest.TestCase):
"""Define the DataFramClient test object."""

Expand Down
34 changes: 17 additions & 17 deletions influxdb/tests/server_tests/client_test_with_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from influxdb import InfluxDBClient
from influxdb.exceptions import InfluxDBClientError

from influxdb.tests import skipIfPYpy, using_pypy, skipServerTests
from influxdb.tests import skip_if_pypy, using_pypy, skip_server_tests
from influxdb.tests.server_tests.base import ManyTestCasesWithServerMixin
from influxdb.tests.server_tests.base import SingleTestCaseWithServerMixin

Expand Down Expand Up @@ -82,15 +82,15 @@ def point(series_name, timestamp=None, tags=None, **fields):
]

if not using_pypy:
dummy_pointDF = {
dummy_point_df = {
"measurement": "cpu_load_short",
"tags": {"host": "server01",
"region": "us-west"},
"dataframe": pd.DataFrame(
[[0.64]], columns=['value'],
index=pd.to_datetime(["2009-11-10T23:00:00Z"]))
}
dummy_pointsDF = [{
dummy_points_df = [{
"measurement": "cpu_load_short",
"tags": {"host": "server01", "region": "us-west"},
"dataframe": pd.DataFrame(
Expand Down Expand Up @@ -120,7 +120,7 @@ def point(series_name, timestamp=None, tags=None, **fields):
]


@skipServerTests
@skip_server_tests
class SimpleTests(SingleTestCaseWithServerMixin, unittest.TestCase):
"""Define the class of simple tests."""

Expand Down Expand Up @@ -267,7 +267,7 @@ def test_invalid_port_fails(self):
InfluxDBClient('host', '80/redir', 'username', 'password')


@skipServerTests
@skip_server_tests
class CommonTests(ManyTestCasesWithServerMixin, unittest.TestCase):
"""Define a class to handle common tests for the server."""

Expand All @@ -293,15 +293,15 @@ def test_write_points(self):
"""Test writing points to the server."""
self.assertIs(True, self.cli.write_points(dummy_point))

@skipIfPYpy
@skip_if_pypy
def test_write_points_DF(self):
"""Test writing points with dataframe."""
self.assertIs(
True,
self.cliDF.write_points(
dummy_pointDF['dataframe'],
dummy_pointDF['measurement'],
dummy_pointDF['tags']
dummy_point_df['dataframe'],
dummy_point_df['measurement'],
dummy_point_df['tags']
)
)

Expand Down Expand Up @@ -342,7 +342,7 @@ def test_write_points_check_read_DF(self):
rsp = self.cliDF.query('SELECT * FROM cpu_load_short')
assert_frame_equal(
rsp['cpu_load_short'],
dummy_pointDF['dataframe']
dummy_point_df['dataframe']
)

# Query with Tags
Expand All @@ -351,7 +351,7 @@ def test_write_points_check_read_DF(self):
assert_frame_equal(
rsp[('cpu_load_short',
(('host', 'server01'), ('region', 'us-west')))],
dummy_pointDF['dataframe']
dummy_point_df['dataframe']
)

def test_write_multiple_points_different_series(self):
Expand Down Expand Up @@ -407,21 +407,21 @@ def test_write_multiple_points_different_series_DF(self):
for i in range(2):
self.assertIs(
True, self.cliDF.write_points(
dummy_pointsDF[i]['dataframe'],
dummy_pointsDF[i]['measurement'],
dummy_pointsDF[i]['tags']))
dummy_points_df[i]['dataframe'],
dummy_points_df[i]['measurement'],
dummy_points_df[i]['tags']))
time.sleep(1)
rsp = self.cliDF.query('SELECT * FROM cpu_load_short')

assert_frame_equal(
rsp['cpu_load_short'],
dummy_pointsDF[0]['dataframe']
dummy_points_df[0]['dataframe']
)

rsp = self.cliDF.query('SELECT * FROM memory')
assert_frame_equal(
rsp['memory'],
dummy_pointsDF[1]['dataframe']
dummy_points_df[1]['dataframe']
)

def test_write_points_batch(self):
Expand Down Expand Up @@ -786,7 +786,7 @@ def test_query_multiple_series(self):
self.cli.write_points(pts)


@skipServerTests
@skip_server_tests
class UdpTests(ManyTestCasesWithServerMixin, unittest.TestCase):
"""Define a class to test UDP series."""

Expand Down