Merge pull request #111 from eReuse/bugfix/bug-#1860

Bugfix/bug #1860
This commit is contained in:
cayop 2021-01-22 14:35:04 +01:00 committed by GitHub
commit 6a69234a4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 1 deletions

View File

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

View File

@ -371,6 +371,28 @@ def test_snapshot_component_containing_components(user: UserClient):
user.post(s, res=Snapshot, status=ValidationError) 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 @pytest.mark.mvp
def test_erase_privacy_standards_endtime_sort(user: UserClient): def test_erase_privacy_standards_endtime_sort(user: UserClient):
"""Tests a Snapshot with EraseSectors and the resulting privacy """Tests a Snapshot with EraseSectors and the resulting privacy