Exemple #1
0
class TestStatisticsResponse(AbstractResponse):
    """Returns statistics of a test."""
    PROPERTIES = [
        NumberField(name="min", required=True),
        NumberField(name="avg", required=True),
        NumberField(name="max", required=True)
    ]
Exemple #2
0
class StatisticsRequestModel(AbstractAPIModel):
    """Model that contains name of a test or component."""
    PROPERTIES = [
        StringField(name="test_name", required=True),
        NumberField(name="max_sample_size", required=False),
        NumberField(name="min_duration_cut", required=False),
        NumberField(name="max_iterations", required=False),
        NumberField(name="acceptable_ratio", required=False)
    ]
Exemple #3
0
class SignatureResponse(AbstractResponse):
    """Returns in response to get or create signature data action.

    The response contains data of a matching signature if there is one.
    """
    PROPERTIES = [
        BoolField(name="is_new", required=True),
        NumberField(name="id", required=True),
        StringField(name="link", required=True)
    ]
Exemple #4
0
class TestResultModel(AbstractAPIModel):
    """Describes the result of a test.

    Args:
        result_code (number): the end result code of the test.
        info (str): additional info of the test run.
    """
    PROPERTIES = [
        NumberField(name="result_code", required=True),
        StringField(name="info", required=True)
    ]
Exemple #5
0
class TestControlOperationParamsModel(AbstractAPIModel):
    """Generic data structure of test control operations.

    Args:
        token (str): the session token of the current test run.
        test_id (number): the relevant test to be influenced by the operation.
    """
    PROPERTIES = [
        StringField(name="token", required=True, location="query"),
        NumberField(name="test_id", required=True, location="query")
    ]
Exemple #6
0
class TestModel(AbstractAPIModel):
    """Test model structure.

    Args:
        id (number): the id of the test.
        name (str): the name of the test.
        class (str): the classname of the test.
        subtests (list): list of TestModel. Sub-tests of the current test.
    """
    TITLE = "Test"
    PROPERTIES = [
        NumberField(name="id"),
        StringField(name="name"),
        StringField(name="class"),
        ArrayField(name="subtests",
                   items_type=DynamicType("TestModel",
                                          "rotest.api.common.models"))
    ]