Skip to content

Commit

Permalink
Remove unnecessary parentheses from class defs
Browse files Browse the repository at this point in the history
Change-Id: I1c4919d1bfe9a1557970561fab48031fb930b82c
  • Loading branch information
volans- committed Aug 2, 2018
1 parent ece8461 commit cf1cbea
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion cumin/tests/integration/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def get_ls_expected_lines(params):


@add_variants_methods(range(len(_VARIANTS_PARAMETERS)))
class TestCLI():
class TestCLI:
"""CLI module tests."""

def setup_method(self, _):
Expand Down
2 changes: 1 addition & 1 deletion cumin/tests/unit/backends/external/wrong_inheritance.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Test external backend module with wrong inheritance of the query class."""


class WrongInheritance():
class WrongInheritance:
"""Test query class with wrong inheritance."""


Expand Down
2 changes: 1 addition & 1 deletion cumin/tests/unit/backends/test_direct.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def test_direct_query_class():
assert isinstance(query, BaseQuery)


class TestDirectQuery():
class TestDirectQuery:
"""Direct backend query test class."""

def setup_method(self, _):
Expand Down
2 changes: 1 addition & 1 deletion cumin/tests/unit/backends/test_knownhosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def test_knownhosts_query_class():
assert isinstance(query, BaseQuery)


class TestKnownhostsQuery():
class TestKnownhostsQuery:
"""Knownhosts backend query test class."""

def setup_method(self, _):
Expand Down
2 changes: 1 addition & 1 deletion cumin/tests/unit/backends/test_openstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def test_key_value_tokens():
@mock.patch('cumin.backends.openstack.keystone_client.Client')
@mock.patch('cumin.backends.openstack.keystone_session.Session')
@mock.patch('cumin.backends.openstack.keystone_identity.Password')
class TestOpenStackQuery():
class TestOpenStackQuery:
"""OpenStack backend query test class."""

def setup_method(self, _):
Expand Down
8 changes: 4 additions & 4 deletions cumin/tests/unit/backends/test_puppetdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def test_hosts_selection():
assert parsed[0].asDict() == hosts


class TestPuppetDBQueryV3():
class TestPuppetDBQueryV3:
"""PuppetDB backend query test class for API version 3."""

def setup_method(self, _):
Expand All @@ -51,7 +51,7 @@ def test_instantiation(self):
assert self.query.url == 'https://localhost:443/v3/'


class TestPuppetDBQueryV4():
class TestPuppetDBQueryV4:
"""PuppetDB backend query test class for API version 4."""

def setup_method(self, _):
Expand Down Expand Up @@ -102,7 +102,7 @@ def test_puppetdb_query_init_invalid():


@mock.patch.object(puppetdb.PuppetDBQuery, '_api_call')
class TestPuppetDBQueryBuildV3():
class TestPuppetDBQueryBuildV3:
"""PuppetDB backend API v3 query build test class."""

def setup_method(self, _):
Expand Down Expand Up @@ -155,7 +155,7 @@ def test_and_and(self, mocked_api_call):


@mock.patch.object(puppetdb.PuppetDBQuery, '_api_call')
class TestPuppetDBQueryBuildV4():
class TestPuppetDBQueryBuildV4:
"""PuppetDB backend API v4 query build test class."""

def setup_method(self, _):
Expand Down
6 changes: 3 additions & 3 deletions cumin/tests/unit/transports/test_clustershell.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def test_worker_class(task_self):
task_self.assert_called_once_with()


class TestClusterShellWorker():
class TestClusterShellWorker:
"""ClusterShell backend worker test class."""

@mock.patch('cumin.transports.clustershell.Task.task_self')
Expand Down Expand Up @@ -144,7 +144,7 @@ def test_handler_getter(self):

def test_handler_setter_invalid(self):
"""Raise WorkerError if trying to set it to an invalid class or value"""
class InvalidClass():
class InvalidClass:
"""Invalid class."""

pass
Expand Down Expand Up @@ -177,7 +177,7 @@ def iter_buffers():
yield 'output {}'.format(i), ['node{}0'.format(i), 'node{}1'.format(i), 'node{}2'.format(i)]


class TestBaseEventHandler():
class TestBaseEventHandler:
"""BaseEventHandler test class."""

def setup_method(self, *args): # pylint: disable=arguments-differ
Expand Down
16 changes: 8 additions & 8 deletions cumin/tests/unit/transports/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def handler(self, value):
self._handler = value


class Commands():
class Commands:
"""Helper class to define a list of commands to test."""

command_with_options = r'command --with "options" -a -n -d params with\ spaces'
Expand Down Expand Up @@ -63,7 +63,7 @@ def __init__(self):


@pytest.mark.parametrize('command', Commands().commands)
class TestCommandParametrized():
class TestCommandParametrized:
"""Command class tests executed for each parametrized command."""

def test_instantiation(self, command):
Expand Down Expand Up @@ -134,7 +134,7 @@ def test_ok_codes_getter(self, command):
assert command['obj'].ok_codes == command.get('ok_codes', [0])


class TestCommand():
class TestCommand:
"""Command class non parametrized tests."""

def test_eq_equivalent(self):
Expand Down Expand Up @@ -197,7 +197,7 @@ def test_ok_codes_setter(self):
command.ok_codes = codes


class TestState():
class TestState:
"""State class tests."""

def test_instantiation_no_init(self):
Expand Down Expand Up @@ -308,7 +308,7 @@ def test_update_ok(self):
assert state.current == transports.State.pending


class TestTarget():
class TestTarget:
"""Target class tests."""

def setup_method(self, _):
Expand Down Expand Up @@ -403,7 +403,7 @@ def test_first_batch(self):
assert isinstance(target.first_batch, NodeSet)


class TestBaseWorker():
class TestBaseWorker:
"""Concrete BaseWorker class for tests."""

def test_instantiation(self):
Expand All @@ -427,7 +427,7 @@ def test_init(self):
assert worker.config == config


class TestConcreteBaseWorker():
class TestConcreteBaseWorker:
"""BaseWorker test class."""

def setup_method(self, _):
Expand Down Expand Up @@ -501,7 +501,7 @@ def test_success_threshold_setter(self):
assert self.worker._success_threshold == pytest.approx(0.3)


class TestModuleFunctions():
class TestModuleFunctions:
"""Transports module functions test class."""

def test_validate_list(self):
Expand Down
2 changes: 1 addition & 1 deletion cumin/transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from cumin import CuminError


class Transport():
class Transport:
"""Transport factory class.
The transport layer is the one used to convey the commands to be executed into the selected hosts. The transport
Expand Down
6 changes: 3 additions & 3 deletions cumin/transports/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class InvalidStateError(CuminError):
"""Exception raised when an invalid transition for a node's State was attempted."""


class Command():
class Command:
"""Class to represent a command."""

def __init__(self, command, timeout=None, ok_codes=None):
Expand Down Expand Up @@ -179,7 +179,7 @@ def ok_codes(self, value):
self._ok_codes = value


class State():
class State:
"""State machine for the state of a host.
.. attribute:: current
Expand Down Expand Up @@ -395,7 +395,7 @@ def _cmp(self, other):
raise ValueError("Unable to compare instance of '{other}' with State instance".format(other=type(other)))


class Target():
class Target:
"""Targets management class."""

def __init__(self, hosts, batch_size=None, batch_size_ratio=None, batch_sleep=None):
Expand Down
2 changes: 1 addition & 1 deletion cumin/transports/clustershell.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def handler(self, value):
value)


class Node():
class Node:
"""Node class to represent each target node."""

def __init__(self, name, commands):
Expand Down

0 comments on commit cf1cbea

Please sign in to comment.