test and fixed bug 1860
This commit is contained in:
parent
14a27a3d85
commit
47b7b4224c
|
@ -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:
|
||||||
|
|
|
@ -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
|
||||||
|
|
Reference in a new issue