Skip to content

Commit

Permalink
Fix minor flake8 issues
Browse files Browse the repository at this point in the history
Signed-off-by: Aurélien Bompard <[email protected]>
  • Loading branch information
abompard committed Jul 2, 2020
1 parent 6a2e9cb commit f6fe7ac
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion collectd_rabbitmq/rabbit.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def get_stats(self, stat_type, stat_name, vhost_name):
's' if not stat_name else '',
vhost_name))

if stat_type not in('exchange', 'queue'):
if stat_type not in ('exchange', 'queue'):
raise ValueError("Unsupported stat type {0}".format(stat_type))
stat_name_func = getattr(self, 'get_{0}_names'.format(stat_type))
if not vhost_name:
Expand Down
2 changes: 2 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ class Mock(MagicMock):
@classmethod
def __getattr__(cls, name):
return MagicMock()


MOCK_MODULES = ['collectd']

sys.modules.update(('collectd', Mock()) for mod_name in MOCK_MODULES)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_collectd_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ def test_dispatch_queue_stats(self, mock_urlopen, mock_vhosts):
@patch.object(collectd_plugin.rabbit.RabbitMQStats, 'get_vhosts')
@patch('collectd_rabbitmq.rabbit.urllib.request.urlopen')
def test_dispatch_queue_stats_consumer_utilisation(
self, mock_urlopen, mock_vhosts):
self, mock_urlopen, mock_vhosts):
"""
Assert queues are dispatched with preoper data.
Args:
Expand Down
2 changes: 1 addition & 1 deletion tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def get_node_stats_data():
"disk_free": 20234559488,
"disk_free_details": {
"rate": -27852.799999999999
},
},
"disk_free_limit": 50000000,

"fd_total": 150000,
Expand Down
1 change: 1 addition & 0 deletions utils/generate_load.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def main():

connection.close()


if __name__ == "__main__":
import sys
sys.exit(main())

0 comments on commit f6fe7ac

Please sign in to comment.