Fix test_test_data_storage

This commit is contained in:
Xavier Bustamante Talavera 2018-10-27 09:01:13 +02:00
parent 42c5bee947
commit a600dd8e54
1 changed files with 4 additions and 1 deletions

View File

@ -326,7 +326,10 @@ def test_test_data_storage(user: UserClient):
"""Tests a Snapshot with EraseSectors.""" """Tests a Snapshot with EraseSectors."""
s = file('erase-sectors-2-hdd.snapshot') s = file('erase-sectors-2-hdd.snapshot')
snapshot, _ = user.post(res=Snapshot, data=s) snapshot, _ = user.post(res=Snapshot, data=s)
incidence_test = next(ev for ev in snapshot['events'] if ev['reallocatedSectorCount'] == 15) incidence_test = next(
ev for ev in snapshot['events']
if ev.get('reallocatedSectorCount', None) == 15
)
assert incidence_test['incidence'] assert incidence_test['incidence']
assert incidence_test['description'] == 'Warning: Drive failure expected soon.' assert incidence_test['description'] == 'Warning: Drive failure expected soon.'