Merge pull request #369 from eReuse/bugfix/test_data_storage

Bugfix/test data storage
This commit is contained in:
cayop 2022-09-28 12:30:10 +02:00 committed by GitHub
commit 7335c04f8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -296,6 +296,14 @@ class TestDataStorage(Test):
offline_uncorrectable = Integer(data_key='offlineUncorrectable')
remaining_lifetime_percentage = Integer(data_key='remainingLifetimePercentage')
@post_load
def default_remaining_lifetime_percentage(self, data):
if not data.get('remaining_lifetime_percentage'):
return
if data.get('remaining_lifetime_percentage') > 100:
data['remaining_lifetime_percentage'] = None
class StressTest(Test):
__doc__ = m.StressTest.__doc__