mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-04-01 09:30:29 +00:00
snapshot: Minor styling fixes
- Avoid use of _ in functional steps. - flake8 fixes. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
0b9922434c
commit
1ec5b213ad
@ -29,13 +29,13 @@ Scenario: Create a snapshot
|
||||
Then there should be 1 snapshot in the list
|
||||
|
||||
Scenario: Configure snapshots
|
||||
Given snapshots are configured with free_space 30, timeline snapshots disabled, software snapshots disabled, hourly limit 10, daily limit 3, weekly limit 2, monthly limit 2, yearly limit 0
|
||||
When I configure snapshots with free_space 20, timeline snapshots enabled, software snapshots enabled, hourly limit 3, daily limit 2, weekly limit 1, monthly limit 1, yearly limit 1
|
||||
Then snapshots should be configured with free_space 20, timeline snapshots enabled, software snapshots enabled, hourly limit 3, daily limit 2, weekly limit 1, monthly limit 1, yearly limit 1
|
||||
Given snapshots are configured with free space 30, timeline snapshots disabled, software snapshots disabled, hourly limit 10, daily limit 3, weekly limit 2, monthly limit 2, yearly limit 0
|
||||
When I configure snapshots with free space 20, timeline snapshots enabled, software snapshots enabled, hourly limit 3, daily limit 2, weekly limit 1, monthly limit 1, yearly limit 1
|
||||
Then snapshots should be configured with free space 20, timeline snapshots enabled, software snapshots enabled, hourly limit 3, daily limit 2, weekly limit 1, monthly limit 1, yearly limit 1
|
||||
|
||||
Scenario: Backup and restore snapshot
|
||||
When I configure snapshots with free_space 30, timeline snapshots disabled, software snapshots disabled, hourly limit 10, daily limit 3, weekly limit 2, monthly limit 2, yearly limit 0
|
||||
When I configure snapshots with free space 30, timeline snapshots disabled, software snapshots disabled, hourly limit 10, daily limit 3, weekly limit 2, monthly limit 2, yearly limit 0
|
||||
And I create a backup of the snapshot app data
|
||||
And I configure snapshots with free_space 20, timeline snapshots enabled, software snapshots enabled, hourly limit 3, daily limit 2, weekly limit 1, monthly limit 1, yearly limit 1
|
||||
And I configure snapshots with free space 20, timeline snapshots enabled, software snapshots enabled, hourly limit 3, daily limit 2, weekly limit 1, monthly limit 1, yearly limit 1
|
||||
And I restore the snapshot app data backup
|
||||
Then snapshots should be configured with free_space 30, timeline snapshots disabled, software snapshots disabled, hourly limit 10, daily limit 3, weekly limit 2, monthly limit 2, yearly limit 0
|
||||
Then snapshots should be configured with free space 30, timeline snapshots disabled, software snapshots disabled, hourly limit 10, daily limit 3, weekly limit 2, monthly limit 2, yearly limit 0
|
||||
|
||||
@ -108,7 +108,7 @@ def verify_snapshot_count(browser, count):
|
||||
|
||||
@given(
|
||||
parsers.parse(
|
||||
'snapshots are configured with free_space {free_space:d}, timeline '
|
||||
'snapshots are configured with free space {free_space:d}, timeline '
|
||||
'snapshots {timeline_enabled:w}, software snapshots '
|
||||
'{software_enabled:w}, hourly limit {hourly:d}, daily limit {daily:d}'
|
||||
', weekly limit {weekly:d}, monthly limit {monthly:d}, yearly limit '
|
||||
@ -125,7 +125,7 @@ def snapshot_given_set_configuration(browser, free_space, timeline_enabled,
|
||||
|
||||
@when(
|
||||
parsers.parse(
|
||||
'I configure snapshots with free_space {free_space:d}, '
|
||||
'I configure snapshots with free space {free_space:d}, '
|
||||
'timeline snapshots {timeline_enabled:w}, '
|
||||
'software snapshots {software_enabled:w}, hourly limit {hourly:d}, '
|
||||
'daily limit {daily:d}, weekly limit {weekly:d}, monthly limit '
|
||||
@ -142,7 +142,7 @@ def snapshot_set_configuration(browser, free_space, timeline_enabled,
|
||||
|
||||
@then(
|
||||
parsers.parse(
|
||||
'snapshots should be configured with free_space {free_space:d}, '
|
||||
'snapshots should be configured with free space {free_space:d}, '
|
||||
'timeline snapshots {timeline_enabled:w}, software snapshots '
|
||||
'{software_enabled:w}, hourly limit {hourly:d}, daily limit '
|
||||
'{daily:d}, weekly limit {weekly:d}, monthly limit {monthly:d}, '
|
||||
@ -152,7 +152,6 @@ def snapshot_assert_configuration(browser, free_space, timeline_enabled,
|
||||
monthly, yearly):
|
||||
timeline_enabled = (timeline_enabled == 'enabled')
|
||||
software_enabled = (software_enabled == 'enabled')
|
||||
print(system.snapshot_get_configuration(browser))
|
||||
assert (free_space, timeline_enabled, software_enabled, hourly, daily,
|
||||
weekly, monthly,
|
||||
yearly) == system.snapshot_get_configuration(browser)
|
||||
|
||||
@ -100,10 +100,10 @@ def update_configuration(request, old_status, new_status):
|
||||
if old_status[key] != new_status[key]:
|
||||
if 'limit' in key:
|
||||
return stamp.format('0-{}'.format(new_status[key]))
|
||||
else:
|
||||
return stamp.format(new_status[key])
|
||||
else:
|
||||
return None
|
||||
|
||||
return stamp.format(new_status[key])
|
||||
|
||||
return None
|
||||
|
||||
config = filter(
|
||||
None,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user