mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
fix formatting issues
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
1 parent
fa74a26042
commit
eb83e00011
134 files changed
+598
-720
No files matched your search
@@ -14,7 +14,6 @@
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
"""
|
||||
Test module for custom context processors.
|
||||
"""
|
||||
@@ -37,7 +36,7 @@ def fixture_menu():
|
||||
|
||||
def test_common():
|
||||
"""Verify that the common() function returns the correct values."""
|
||||
cfg.read() # initialize config settings
|
||||
cfg.read() # initialize config settings
|
||||
|
||||
request = HttpRequest()
|
||||
request.path = '/aaa/bbb/ccc/'
|
||||
|
||||
@@ -65,8 +65,8 @@ def test_shortcuts_api_with_empty_custom_shortcuts_list():
|
||||
def test_shortcuts_api_with_custom_nextcloud_shortcut():
|
||||
shortcuts = get_shortcuts_as_json()
|
||||
assert len(shortcuts['shortcuts']) >= 1
|
||||
assert any(
|
||||
shortcut['name'] == 'NextCloud' for shortcut in shortcuts['shortcuts'])
|
||||
assert any(shortcut['name'] == 'NextCloud'
|
||||
for shortcut in shortcuts['shortcuts'])
|
||||
|
||||
|
||||
@pytest.mark.usefixtures('nextcloud_shortcut')
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
"""
|
||||
Test module for key/value store.
|
||||
"""
|
||||
@@ -38,8 +37,15 @@ def test_get_set():
|
||||
def test_get_set_complex_structures():
|
||||
"""Verify that complex structures can be stored and retrieved."""
|
||||
key = 'compex_structure'
|
||||
expected_value = {'k1': 1, 'k2': [2, 3], 'k3': 4.5, 'k4': 'Hello',
|
||||
'k5': {'a': 'b'}}
|
||||
expected_value = {
|
||||
'k1': 1,
|
||||
'k2': [2, 3],
|
||||
'k3': 4.5,
|
||||
'k4': 'Hello',
|
||||
'k5': {
|
||||
'a': 'b'
|
||||
}
|
||||
}
|
||||
kvstore.set(key, expected_value)
|
||||
actual_value = kvstore.get(key)
|
||||
assert expected_value == actual_value
|
||||
|
||||
@@ -42,7 +42,6 @@ def fixture_kwargs():
|
||||
|
||||
class TestSetupMiddleware:
|
||||
"""Test cases for setup middleware."""
|
||||
|
||||
@staticmethod
|
||||
@pytest.fixture(name='middleware')
|
||||
def fixture_middleware(load_cfg):
|
||||
@@ -135,7 +134,6 @@ class TestSetupMiddleware:
|
||||
|
||||
class TestAdminMiddleware:
|
||||
"""Test cases for admin middleware."""
|
||||
|
||||
@staticmethod
|
||||
@pytest.fixture(name='middleware')
|
||||
def fixture_middleware(load_cfg):
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
"""
|
||||
Test module for network configuration utilities.
|
||||
"""
|
||||
|
||||
@@ -51,9 +51,9 @@ def test_highlighting():
|
||||
'text': 'create'
|
||||
}]
|
||||
|
||||
tests = [['/abc/123/crunch/new/', '/abc/123/crunch/'], [
|
||||
'/abc/123/create/', '/abc/123/create/'
|
||||
], ['/abc/123/nolink/', '/abc/123/'], ['/abc/123/abx/', '/abc/123/'],
|
||||
tests = [['/abc/123/crunch/new/', '/abc/123/crunch/'],
|
||||
['/abc/123/create/', '/abc/123/create/'],
|
||||
['/abc/123/nolink/', '/abc/123/'], ['/abc/123/abx/', '/abc/123/'],
|
||||
['/abc/123/ab/', '/abc/123/'], ['/abc/123/', '/abc/123/']]
|
||||
|
||||
for check_path, expected_active_path in tests:
|
||||
|
||||
@@ -30,7 +30,6 @@ from plinth.utils import YAMLFile, is_user_admin
|
||||
|
||||
class TestIsAdminUser:
|
||||
"""Test class for is_user_admin utility."""
|
||||
|
||||
@staticmethod
|
||||
@pytest.fixture(name='web_request')
|
||||
def fixture_web_request():
|
||||
@@ -113,9 +112,7 @@ class TestYAMLFileUtil:
|
||||
|
||||
with open(test_file.name, 'w') as conf_file:
|
||||
conf_file.write(
|
||||
ruamel.yaml.round_trip_dump({
|
||||
'property1': self.kv_pair
|
||||
}))
|
||||
ruamel.yaml.round_trip_dump({'property1': self.kv_pair}))
|
||||
|
||||
with YAMLFile(test_file.name) as file_conf:
|
||||
file_conf['property2'] = self.kv_pair
|
||||
|
||||
Reference in new issue
Block a user