mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-27 10:44:33 +00:00
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:
parent
575f07b8e5
commit
8fac6a71fe
@ -103,17 +103,15 @@ def configure_shadowsocks(session_browser):
|
|||||||
|
|
||||||
|
|
||||||
@when(
|
@when(
|
||||||
parsers.parse(
|
parsers.parse('I configure shadowsocks with server {server:S} and '
|
||||||
'I configure shadowsocks with server {server:S} and password {password:w}'
|
'password {password:w}'))
|
||||||
))
|
|
||||||
def configure_shadowsocks_with_details(session_browser, server, password):
|
def configure_shadowsocks_with_details(session_browser, server, password):
|
||||||
application.configure_shadowsocks(session_browser, server, password)
|
application.configure_shadowsocks(session_browser, server, password)
|
||||||
|
|
||||||
|
|
||||||
@then(
|
@then(
|
||||||
parsers.parse(
|
parsers.parse('shadowsocks should be configured with server {server:S} '
|
||||||
'shadowsocks should be configured with server {server:S} and password {password:w}'
|
'and password {password:w}'))
|
||||||
))
|
|
||||||
def assert_shadowsocks_configuration(session_browser, server, password):
|
def assert_shadowsocks_configuration(session_browser, server, password):
|
||||||
assert (
|
assert (
|
||||||
server,
|
server,
|
||||||
@ -147,9 +145,8 @@ def add_share(session_browser, name, path, group):
|
|||||||
|
|
||||||
|
|
||||||
@when(
|
@when(
|
||||||
parsers.parse(
|
parsers.parse('I edit share {old_name:w} to {new_name:w} from path {path} '
|
||||||
'I edit share {old_name:w} to {new_name:w} from path {path} for {group:w}'
|
'for {group:w}'))
|
||||||
))
|
|
||||||
def edit_share(session_browser, old_name, new_name, path, group):
|
def edit_share(session_browser, old_name, new_name, path, group):
|
||||||
application.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')
|
application.radicale_set_access_rights(session_browser, 'owner_only')
|
||||||
|
|
||||||
|
|
||||||
@given(
|
@given('the access rights are set to "any user can view, but only the '
|
||||||
'the access rights are set to "any user can view, but only the owner can make changes"'
|
'owner can make changes"')
|
||||||
)
|
|
||||||
def radicale_given_owner_write(session_browser):
|
def radicale_given_owner_write(session_browser):
|
||||||
application.radicale_set_access_rights(session_browser, 'owner_write')
|
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')
|
application.radicale_set_access_rights(session_browser, 'owner_only')
|
||||||
|
|
||||||
|
|
||||||
@when(
|
@when('I change the access rights to "any user can view, but only the '
|
||||||
'I change the access rights to "any user can view, but only the owner can make changes"'
|
'owner can make changes"')
|
||||||
)
|
|
||||||
def radicale_set_owner_write(session_browser):
|
def radicale_set_owner_write(session_browser):
|
||||||
application.radicale_set_access_rights(session_browser, 'owner_write')
|
application.radicale_set_access_rights(session_browser, 'owner_write')
|
||||||
|
|
||||||
@ -412,9 +407,8 @@ def radicale_check_owner_only(session_browser):
|
|||||||
session_browser) == 'owner_only'
|
session_browser) == 'owner_only'
|
||||||
|
|
||||||
|
|
||||||
@then(
|
@then('the access rights should be "any user can view, but only the '
|
||||||
'the access rights should be "any user can view, but only the owner can make changes"'
|
'owner can make changes"')
|
||||||
)
|
|
||||||
def radicale_check_owner_write(session_browser):
|
def radicale_check_owner_write(session_browser):
|
||||||
assert application.radicale_get_access_rights(
|
assert application.radicale_get_access_rights(
|
||||||
session_browser) == 'owner_write'
|
session_browser) == 'owner_write'
|
||||||
|
|||||||
@ -22,8 +22,8 @@ def access_application(session_browser, app_name):
|
|||||||
|
|
||||||
@when(
|
@when(
|
||||||
parsers.parse(
|
parsers.parse(
|
||||||
'I upload an image named {image:S} to mediawiki with credentials {username:w} and '
|
'I upload an image named {image:S} to mediawiki with credentials '
|
||||||
'{password:w}'))
|
'{username:w} and {password:w}'))
|
||||||
def upload_image(session_browser, username, password, image):
|
def upload_image(session_browser, username, password, image):
|
||||||
site.upload_image_mediawiki(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(
|
@when(
|
||||||
parsers.parse(
|
parsers.parse('I upload the sample local file to coquelicot with password '
|
||||||
'I upload the sample local file to coquelicot with password {password:w}'
|
'{password:w}'))
|
||||||
))
|
|
||||||
def coquelicot_upload_file(session_browser, sample_local_file, password):
|
def coquelicot_upload_file(session_browser, sample_local_file, password):
|
||||||
url = site.upload_file_to_coquelicot(session_browser,
|
url = site.upload_file_to_coquelicot(session_browser,
|
||||||
sample_local_file['file_path'],
|
sample_local_file['file_path'],
|
||||||
|
|||||||
@ -168,9 +168,8 @@ def dynamicdns_has_original_config(session_browser):
|
|||||||
|
|
||||||
|
|
||||||
@when(
|
@when(
|
||||||
parsers.parse(
|
parsers.parse('I create a backup of the {app_name:w} app data with '
|
||||||
'I create a backup of the {app_name:w} app data with name {archive_name:w}'
|
'name {archive_name:w}'))
|
||||||
))
|
|
||||||
def backup_create(session_browser, app_name, archive_name):
|
def backup_create(session_browser, app_name, archive_name):
|
||||||
system.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(
|
@when(
|
||||||
parsers.parse(
|
parsers.parse('I configure pagekite with host {host:S}, port {port:d}, '
|
||||||
'I configure pagekite with host {host:S}, port {port:d}, kite name {kite_name:S} and kite secret {kite_secret:w}'
|
'kite name {kite_name:S} and kite secret {kite_secret:w}'))
|
||||||
))
|
|
||||||
def pagekite_configure(session_browser, host, port, kite_name, kite_secret):
|
def pagekite_configure(session_browser, host, port, kite_name, kite_secret):
|
||||||
system.pagekite_configure(session_browser, host, port, kite_name,
|
system.pagekite_configure(session_browser, host, port, kite_name,
|
||||||
kite_secret)
|
kite_secret)
|
||||||
@ -213,8 +211,8 @@ def pagekite_configure(session_browser, host, port, kite_name, kite_secret):
|
|||||||
|
|
||||||
@then(
|
@then(
|
||||||
parsers.parse(
|
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,
|
def pagekite_assert_configured(session_browser, host, port, kite_name,
|
||||||
kite_secret):
|
kite_secret):
|
||||||
assert (host, port, kite_name,
|
assert (host, port, kite_name,
|
||||||
|
|||||||
@ -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'] = os.environ.get('FREEDOMBOX_URL',
|
||||||
config['DEFAULT']['url'])
|
config['DEFAULT']['url'])
|
||||||
config['DEFAULT']['samba_port'] = os.environ.get('FREEDOMBOX_SAMBA_PORT',
|
config['DEFAULT']['samba_port'] = os.environ.get(
|
||||||
config['DEFAULT']['samba_port'])
|
'FREEDOMBOX_SAMBA_PORT', config['DEFAULT']['samba_port'])
|
||||||
|
|||||||
@ -216,7 +216,8 @@ def mldonkey_remove_all_ed2k_files(browser):
|
|||||||
def mldonkey_upload_sample_ed2k_file(browser):
|
def mldonkey_upload_sample_ed2k_file(browser):
|
||||||
"""Upload a sample ed2k file into mldonkey."""
|
"""Upload a sample ed2k file into mldonkey."""
|
||||||
browser.visit(config['DEFAULT']['url'] + '/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)
|
_mldonkey_submit_command(browser, dllink_command)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user