Skip to content

Commit

Permalink
tests: fix new pylint reported issues
Browse files Browse the repository at this point in the history
Change-Id: I8d8e09c10bab6f630e7aa27e8078c37b472fede3
  • Loading branch information
volans- committed May 13, 2020
1 parent 5e6fa13 commit ae8359b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions cumin/backends/puppetdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ def _get_resource_query(self, key, value=None, operator='='): # pylint: disable
raise InvalidQueryError(("Resource key cannot contain both '%' (query a resource's parameter) and '@' "
"(query a resource's field)"))

elif '%' in key:
if '%' in key:
# Querying a specific parameter of the resource
if operator == '~' and self.api_version == 3:
raise InvalidQueryError('Regex operations are not supported in PuppetDB API v3 for resource parameters')
Expand Down Expand Up @@ -487,7 +487,7 @@ def _get_special_resource_query(self, category, key, value, operator):
if all(char in key for char in ('%', '@')):
raise InvalidQueryError(("Resource key cannot contain both '%' (query a resource's parameter) and '@' "
"(query a resource's field)"))
elif '%' in key:
if '%' in key:
special = '%'
key, param = key.split('%')
elif '@' in key:
Expand Down
2 changes: 1 addition & 1 deletion cumin/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def get_hosts(args, config):

if answer in 'yY':
break
elif answer in 'nN':
if answer in 'nN':
raise KeyboardInterruptError

else:
Expand Down
2 changes: 0 additions & 2 deletions cumin/tests/unit/transports/test_clustershell.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,6 @@ def test_handler_setter_invalid(self):
class InvalidClass:
"""Invalid class."""

pass

with pytest.raises(WorkerError, match='handler must be one of'):
self.worker.handler = 'invalid-handler'

Expand Down

0 comments on commit ae8359b

Please sign in to comment.