test and fixed bug 1860

This commit is contained in:
Cayo Puigdefabregas 2021-01-22 13:19:29 +01:00
parent 14a27a3d85
commit 47b7b4224c
2 changed files with 24 additions and 1 deletions

View File

@ -1193,7 +1193,8 @@ class EreusePrice(Price):
MULTIPLIER = {
Computer: 20,
Desktop: 20,
Laptop: 30
Laptop: 30,
Server: 40
}
class Type:

View File

@ -371,6 +371,28 @@ def test_snapshot_component_containing_components(user: UserClient):
user.post(s, res=Snapshot, status=ValidationError)
@pytest.mark.mvp
def test_ereuse_price(user: UserClient):
"""Tests a Snapshot with EraseSectors and the resulting privacy
properties.
This tests ensures that only the last erasure is picked up, as
erasures have always custom endTime value set.
"""
s = file('erase-sectors.snapshot')
assert s['components'][0]['actions'][0]['endTime'] == '2018-06-01T09:12:06+02:00'
s['device']['type'] = 'Server'
snapshot = snapshot_and_check(user, s, action_types=(
EraseSectors.t,
BenchmarkDataStorage.t,
BenchmarkProcessor.t,
RateComputer.t,
EreusePrice.t
), perform_second_snapshot=False)
ereuse_price = snapshot['actions'][-1]
assert len(ereuse_price) > 0
@pytest.mark.mvp
def test_erase_privacy_standards_endtime_sort(user: UserClient):
"""Tests a Snapshot with EraseSectors and the resulting privacy