Skip to content

Commit

Permalink
flake8: fix all tests/library/*.py files
Browse files Browse the repository at this point in the history
This commit modifies all *.py files in ./tests/library/ so flake8
passes.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit e49a524)
(cherry picked from commit fb98f43)
  • Loading branch information
guits authored and dsavineau committed Oct 2, 2020
1 parent e5df63f commit df54883
Show file tree
Hide file tree
Showing 5 changed files with 186 additions and 189 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@ on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.6', '3.7', '3.8' ]
name: Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
python-version: 3.8
architecture: x64
- run: pip install flake8
- run: flake8 --max-line-length 160 ./library/ ./tests/library/
11 changes: 6 additions & 5 deletions tests/library/test_ceph_crush.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import sys
sys.path.append('./library')
import ceph_crush
import pytest

sys.path.append('./library')
import ceph_crush # noqa: E402


class TestCephCrushModule(object):

Expand All @@ -19,14 +20,14 @@ def test_no_host(self):
("root", "maroute"),
]
with pytest.raises(Exception):
result = ceph_crush.sort_osd_crush_location(location, None)
ceph_crush.sort_osd_crush_location(location, None)

def test_lower_than_two_bucket(self):
location = [
("chassis", "monchassis"),
]
with pytest.raises(Exception):
result = ceph_crush.sort_osd_crush_location(location, None)
ceph_crush.sort_osd_crush_location(location, None)

def test_invalid_bucket_type(self):
location = [
Expand All @@ -35,7 +36,7 @@ def test_invalid_bucket_type(self):
("rackyyyyy", "monrack"),
]
with pytest.raises(Exception):
result = ceph_crush.sort_osd_crush_location(location, None)
ceph_crush.sort_osd_crush_location(location, None)

def test_ordering(self):
expected_result = [
Expand Down
10 changes: 4 additions & 6 deletions tests/library/test_ceph_dashboard_user.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import json
import os
import sys
sys.path.append('./library')
import ceph_dashboard_user
from mock.mock import patch, Mock, MagicMock
from mock.mock import patch, MagicMock
import pytest

sys.path.append('./library')
import ceph_dashboard_user # noqa: E402

fake_binary = 'ceph'
fake_cluster = 'ceph'
Expand Down Expand Up @@ -132,4 +130,4 @@ def test_remove_user(self):
fake_user
]

assert ceph_dashboard_user.remove_user(fake_module) == expected_cmd
assert ceph_dashboard_user.remove_user(fake_module) == expected_cmd

0 comments on commit df54883

Please sign in to comment.