From d0eb5cd9c551e84277102ed7a91105735ee40270 Mon Sep 17 00:00:00 2001 From: nad Date: Wed, 13 Mar 2019 16:32:59 +0100 Subject: [PATCH] first iteration tests ratev2 --- ereuse_devicehub/resources/event/models.py | 6 +- ereuse_devicehub/resources/event/schemas.py | 12 +++ tests/test_rate_v2.py | 86 +++++++++++++++++---- 3 files changed, 86 insertions(+), 18 deletions(-) diff --git a/ereuse_devicehub/resources/event/models.py b/ereuse_devicehub/resources/event/models.py index 4cd36961..792e435c 100644 --- a/ereuse_devicehub/resources/event/models.py +++ b/ereuse_devicehub/resources/event/models.py @@ -717,9 +717,8 @@ class TestConnectivity(Test): """ Test to check all this aspects related with functionality connections in devices """ - # TODO name for SIM (3G) - celular_network = Column(Boolean) - SIM.comment = 'Evaluate if SIM works' + cellular_network = Column(Boolean) + cellular_network.comment = 'Evaluate if cellular network works properly' wifi = Column(Boolean) wifi.comment = 'Evaluate if wifi connection works correctly' bluetooth = Column(Boolean) @@ -1007,7 +1006,6 @@ class FinalRate(Rate): """ functionality = relationship(FunctionalityRate, ) - # TODO is necessary?? create a AppearanceRate.. appearance = relationship(TestVisual, ) final_id = Column(UUID(as_uuid=True), ForeignKey(FinalRate.id)) diff --git a/ereuse_devicehub/resources/event/schemas.py b/ereuse_devicehub/resources/event/schemas.py index a58c9c23..11b49217 100644 --- a/ereuse_devicehub/resources/event/schemas.py +++ b/ereuse_devicehub/resources/event/schemas.py @@ -167,6 +167,8 @@ class StressTest(Test): class TestAudio(Test): __doc__ = m.TestAudio.__doc__ + loudspeaker = BDEnum(LoudspeakerRange) + microphone = Boolean() class TestConnectivity(Test): @@ -177,8 +179,18 @@ class TestBattery(Test): __doc__ = m.TestBattery.__doc__ +class TestBios: + __doc__ = m.TestBios.__doc__ + + +class TestBiosDifficulty: + __doc__ = m.TestBiosDifficulty.__doc__ + + + class TestVisual(ManualRate): __doc__ = m.TestVisual.__doc__ + appearance_range = DBEnum(AppearanceRange) class Rate(EventWithOneDevice): diff --git a/tests/test_rate_v2.py b/tests/test_rate_v2.py index 74b2c26e..8a71a119 100644 --- a/tests/test_rate_v2.py +++ b/tests/test_rate_v2.py @@ -1,9 +1,12 @@ import math +import pytest + from ereuse_devicehub.resources.device.models import HardDrive, Processor, RamModule, Device from ereuse_devicehub.resources.event.rate.workbench.v2_0 import Rate +@pytest.mark.xfail(reason='Evaluate') def test_ratev2_general(): """ Test to check if compute all aspects (quality, functionality and appearance) correctly @@ -43,31 +46,86 @@ def test_ratev2_general(): assert math.isclose(rate_device, 2.2, rel_tol=0.001) +@pytest.mark.xfail(reason='Develop') +def test_general_rate_without_quality(): + """ + Test to check if compute correctly general rate if quality rate are missing.. + Final Rate = Func Rate + App Rate + """ + pass + + +@pytest.mark.xfail(reason='Develop') +def test_general_rate_without_functionality(): + """ + Test to check if compute correctly general rate if functionality rate are missing.. + Final Rate = Quality Rate + App Rate + """ + pass + + +@pytest.mark.xfail(reason='Develop') +def test_general_rate_without_appearance(): + """ + Test to check if compute correctly general rate if appearance rate are missing.. + Final Rate = Quality Rate + Functionality Rate + """ + pass + + +@pytest.mark.xfail(reason='Develop') +def test_general_rate_without_quality(): + """ + Test to check if compute correctly general rate if quality rate are missing.. + Final Rate = Func Rate + App Rate + """ + pass + + +# QUALITY RATE TEST CODE + + +@pytest.mark.xfail(reason='Develop') def test_quality_rate(): - """ Test to check all quality aspects - """ - pass - - -def test_functionality_rate(): - """ - Test to check all functionality aspects - :return: + """ + Quality Rate Test + Test to check all quality aspects, we suppose that we have full snapshot with all information and benchmarks """ pass +@pytest.mark.xfail(reason='Develop') def test_component_rate_equal_to_zero(): """ - Test to check all functionality aspects - :return: + Quality Rate Test + Test to check quality aspects with some fields equal to 0 or null """ pass -def tes_component_rate_is_null(): +# FUNCTIONALITY RATE TEST DONE + + +@pytest.mark.xfail(reason='Develop') +def test_functionality_rate(): """ - Test to check all functionality aspects - :return: + Functionality Rate Test + Tests to check all aspects of functionality, we assume we have a complete snapshot with all the information and tests performed.a """ pass + + +@pytest.mark.xfail(reason='Develop') +def test_functionality_rate_miss_tests(): + """ + Functionality Rate Test + Test to check if functionality rate compute correctly without complete information of test. + """ + + +@pytest.mark.xfail(reason='Develop') +def test_update_rate_with_manual_rate(): + """ + Test to check if compute correctly a new rate of a device, if this device input after a manual rate (like visual test) + Computing a new rate with old snapshot information score and aggregate a new test information score. + """