tests: functional: cosmetic: flake8 fixes

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
This commit is contained in:
Sunil Mohan Adapa 2020-05-19 14:56:55 -07:00 committed by Joseph Nuthalapati
parent 575f07b8e5
commit 8fac6a71fe
No known key found for this signature in database
GPG Key ID: 5398F00A2FA43C35
5 changed files with 26 additions and 34 deletions

View File

@ -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'

View File

@ -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'],

View File

@ -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,

View File

@ -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'])

View File

@ -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)