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:
Sunil Mohan Adapa 2019-01-08 13:44:44 -08:00
parent 0b9922434c
commit 1ec5b213ad
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2
3 changed files with 13 additions and 14 deletions

View File

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

View File

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

View File

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