From 8fac6a71fed57d2208a4cadf247e40a9b3fd16dd Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Tue, 19 May 2020 14:56:55 -0700 Subject: [PATCH] tests: functional: cosmetic: flake8 fixes Signed-off-by: Sunil Mohan Adapa Reviewed-by: Joseph Nuthalapati --- .../step_definitions/application.py | 30 ++++++++----------- .../tests/functional/step_definitions/site.py | 9 +++--- .../functional/step_definitions/system.py | 14 ++++----- plinth/tests/functional/support/__init__.py | 4 +-- plinth/tests/functional/support/site.py | 3 +- 5 files changed, 26 insertions(+), 34 deletions(-) diff --git a/plinth/tests/functional/step_definitions/application.py b/plinth/tests/functional/step_definitions/application.py index 5019f3f70..5692b5f64 100644 --- a/plinth/tests/functional/step_definitions/application.py +++ b/plinth/tests/functional/step_definitions/application.py @@ -103,17 +103,15 @@ def configure_shadowsocks(session_browser): @when( - parsers.parse( - 'I configure shadowsocks with server {server:S} and password {password:w}' - )) + parsers.parse('I configure shadowsocks with server {server:S} and ' + 'password {password:w}')) def configure_shadowsocks_with_details(session_browser, server, password): application.configure_shadowsocks(session_browser, server, password) @then( - parsers.parse( - 'shadowsocks should be configured with server {server:S} and password {password:w}' - )) + parsers.parse('shadowsocks should be configured with server {server:S} ' + 'and password {password:w}')) def assert_shadowsocks_configuration(session_browser, server, password): assert ( server, @@ -147,9 +145,8 @@ def add_share(session_browser, name, path, group): @when( - parsers.parse( - 'I edit share {old_name:w} to {new_name:w} from path {path} for {group:w}' - )) + parsers.parse('I edit share {old_name:w} to {new_name:w} from path {path} ' + 'for {group:w}')) def edit_share(session_browser, old_name, new_name, path, group): application.edit_share(session_browser, old_name, new_name, path, group) @@ -376,9 +373,8 @@ def radicale_given_owner_only(session_browser): application.radicale_set_access_rights(session_browser, 'owner_only') -@given( - 'the access rights are set to "any user can view, but only the owner can make changes"' -) +@given('the access rights are set to "any user can view, but only the ' + 'owner can make changes"') def radicale_given_owner_write(session_browser): application.radicale_set_access_rights(session_browser, 'owner_write') @@ -394,9 +390,8 @@ def radicale_set_owner_only(session_browser): application.radicale_set_access_rights(session_browser, 'owner_only') -@when( - 'I change the access rights to "any user can view, but only the owner can make changes"' -) +@when('I change the access rights to "any user can view, but only the ' + 'owner can make changes"') def radicale_set_owner_write(session_browser): application.radicale_set_access_rights(session_browser, 'owner_write') @@ -412,9 +407,8 @@ def radicale_check_owner_only(session_browser): session_browser) == 'owner_only' -@then( - 'the access rights should be "any user can view, but only the owner can make changes"' -) +@then('the access rights should be "any user can view, but only the ' + 'owner can make changes"') def radicale_check_owner_write(session_browser): assert application.radicale_get_access_rights( session_browser) == 'owner_write' diff --git a/plinth/tests/functional/step_definitions/site.py b/plinth/tests/functional/step_definitions/site.py index 038cc9df0..c5b23d6ba 100644 --- a/plinth/tests/functional/step_definitions/site.py +++ b/plinth/tests/functional/step_definitions/site.py @@ -22,8 +22,8 @@ def access_application(session_browser, app_name): @when( parsers.parse( - 'I upload an image named {image:S} to mediawiki with credentials {username:w} and ' - '{password:w}')) + 'I upload an image named {image:S} to mediawiki with credentials ' + '{username:w} and {password:w}')) def upload_image(session_browser, username, password, image): site.upload_image_mediawiki(session_browser, username, password, image) @@ -43,9 +43,8 @@ def verify_upload_password(session_browser, password): @when( - parsers.parse( - 'I upload the sample local file to coquelicot with password {password:w}' - )) + parsers.parse('I upload the sample local file to coquelicot with password ' + '{password:w}')) def coquelicot_upload_file(session_browser, sample_local_file, password): url = site.upload_file_to_coquelicot(session_browser, sample_local_file['file_path'], diff --git a/plinth/tests/functional/step_definitions/system.py b/plinth/tests/functional/step_definitions/system.py index f4913d5c2..89a308c01 100644 --- a/plinth/tests/functional/step_definitions/system.py +++ b/plinth/tests/functional/step_definitions/system.py @@ -168,9 +168,8 @@ def dynamicdns_has_original_config(session_browser): @when( - parsers.parse( - 'I create a backup of the {app_name:w} app data with name {archive_name:w}' - )) + parsers.parse('I create a backup of the {app_name:w} app data with ' + 'name {archive_name:w}')) def backup_create(session_browser, app_name, archive_name): system.backup_create(session_browser, app_name, archive_name) @@ -203,9 +202,8 @@ def backup_restore_from_upload(session_browser, app_name, @when( - parsers.parse( - 'I configure pagekite with host {host:S}, port {port:d}, kite name {kite_name:S} and kite secret {kite_secret:w}' - )) + parsers.parse('I configure pagekite with host {host:S}, port {port:d}, ' + 'kite name {kite_name:S} and kite secret {kite_secret:w}')) def pagekite_configure(session_browser, host, port, kite_name, kite_secret): system.pagekite_configure(session_browser, host, port, kite_name, kite_secret) @@ -213,8 +211,8 @@ def pagekite_configure(session_browser, host, port, kite_name, kite_secret): @then( parsers.parse( - 'pagekite should be configured with host {host:S}, port {port:d}, kite name {kite_name:S} and kite secret {kite_secret:w}' - )) + 'pagekite should be configured with host {host:S}, port {port:d}, ' + 'kite name {kite_name:S} and kite secret {kite_secret:w}')) def pagekite_assert_configured(session_browser, host, port, kite_name, kite_secret): assert (host, port, kite_name, diff --git a/plinth/tests/functional/support/__init__.py b/plinth/tests/functional/support/__init__.py index 9b1d7becd..9532249c2 100644 --- a/plinth/tests/functional/support/__init__.py +++ b/plinth/tests/functional/support/__init__.py @@ -9,5 +9,5 @@ config.read(pathlib.Path(__file__).parent.with_name('config.ini')) config['DEFAULT']['url'] = os.environ.get('FREEDOMBOX_URL', config['DEFAULT']['url']) -config['DEFAULT']['samba_port'] = os.environ.get('FREEDOMBOX_SAMBA_PORT', - config['DEFAULT']['samba_port']) +config['DEFAULT']['samba_port'] = os.environ.get( + 'FREEDOMBOX_SAMBA_PORT', config['DEFAULT']['samba_port']) diff --git a/plinth/tests/functional/support/site.py b/plinth/tests/functional/support/site.py index 0217b65e4..bd8ec80fc 100644 --- a/plinth/tests/functional/support/site.py +++ b/plinth/tests/functional/support/site.py @@ -216,7 +216,8 @@ def mldonkey_remove_all_ed2k_files(browser): def mldonkey_upload_sample_ed2k_file(browser): """Upload a sample ed2k file into mldonkey.""" browser.visit(config['DEFAULT']['url'] + '/mldonkey/') - dllink_command = 'dllink ed2k://|file|foo.bar|123|0123456789ABCDEF0123456789ABCDEF|/' + dllink_command = 'dllink ed2k://|file|foo.bar|123|' \ + '0123456789ABCDEF0123456789ABCDEF|/' _mldonkey_submit_command(browser, dllink_command)