fix error in test multiple rates

This commit is contained in:
nad 2019-06-19 11:41:22 +02:00
parent b0d8ca39fe
commit 02b92e2cf7
1 changed files with 10 additions and 12 deletions

View File

@ -138,8 +138,8 @@ def test_multiple_rates(user: UserClient):
ensuring that the tests / benchmarks...
from the first rate do not contaminate the second rate.
This ensures that rates only takes the last version of actions
and components (in case device has new components, for example).
This ensures that rates only takes all the correct actions
and components rates in case device have new tests/benchmarks.
"""
pc = Desktop(chassis=ComputerChassis.Tower)
hdd = HardDrive(size=476940)
@ -172,15 +172,13 @@ def test_multiple_rates(user: UserClient):
assert price1.price == Decimal('92.4001')
hdd = SolidStateDrive(size=476940)
hdd.actions_one.add(BenchmarkDataStorage(read_speed=222, write_speed=169))
cpu = Processor(cores=1, speed=3.0)
cpu.actions_one.add(BenchmarkProcessor(rate=16069.44))
ssd = SolidStateDrive(size=476940)
ssd.actions_one.add(BenchmarkDataStorage(read_speed=222, write_speed=111))
pc.components |= {
hdd,
ssd,
RamModule(size=2048, speed=1067),
RamModule(size=2048, speed=1067),
cpu
}
# Add test visual with functionality and appearance range
@ -190,13 +188,13 @@ def test_multiple_rates(user: UserClient):
rate2, price2 = RateComputer.compute(pc)
assert rate2.data_storage == 4.27
assert rate2.processor == 3.61
assert rate2.ram == 4.12
assert rate2.data_storage == 4.3
assert rate2.processor == 3.78
assert rate2.ram == 3.95
assert rate2.appearance == 0
assert rate2.functionality == -0.5
assert rate2.rating == 3.37
assert rate2.rating == 3.43
assert rate2.price.price == Decimal('67.4001')
assert price2.price == Decimal('68.6001')