示例#1
0
文件: models.py 项目: gregoil/rotest
class StartTestRunParamsModel(AbstractAPIModel):
    """Start a new run session.

    Args:
        tests (TestModel): the main test to build the run suite from.
        run_data (RunDataModel): the run data details of the current run.
    """
    PROPERTIES = [
        StringField(name="token", required=True),
        ModelField(name="tests", model=TestModel, required=True),
        ModelField(name="run_data", model=RunDataModel, required=True)
    ]
示例#2
0
文件: models.py 项目: rinslow/rotest
class UpdateFieldsParamsModel(AbstractAPIModel):
    """Update fields of a given resource.

    Args:
        resource_descriptor (ResourceDescriptorModel): describes the
            resources to change.
        changes (dict): keys are the object's fields and values are the
            values to change the fields into.
    """
    PROPERTIES = [
        ModelField(name="resource_descriptor", required=True,
                   model=ResourceDescriptorModel),
        ModelField(name="changes", required=True, model=GenericModel),
    ]
示例#3
0
文件: models.py 项目: rinslow/rotest
class AddTestResultParamsModel(AbstractAPIModel):
    """Add a test result to a given test.

    Args:
        test_details (TestControlOperationParamsModel): the details of the
            relevant session datas.
        result (TestResultModel): the result of the test.
    """
    PROPERTIES = [
        ModelField(name="test_details",
                   model=TestControlOperationParamsModel, required=True,
                   location="query"),
        ModelField(name="result", model=TestResultModel, required=True)
    ]
示例#4
0
文件: models.py 项目: gregoil/rotest
class UpdateRunDataParamsModel(AbstractAPIModel):
    """Update run data of a given session run.

    Args:
        run_data (RunDataModel): the new run data to update to.
        token (str): the token of the current session run.
    """
    PROPERTIES = [
        ModelField(name="run_data", model=RunDataModel, required=True),
        StringField(name="token", required=True)
    ]
示例#5
0
文件: models.py 项目: rinslow/rotest
class ResourceDescriptorModel(AbstractAPIModel):
    """Descriptor of a resource.

    Args:
        type (str): the type of the resource.
        properties (dict): django filter properties of the model.
    """
    TITLE = "Resource Descriptor"
    PROPERTIES = [
        StringField(name="type", required=True,
                    example="resources.models.CalculatorData"),
        ModelField(name="properties", model=GenericModel, required=True)
    ]
示例#6
0
文件: models.py 项目: rinslow/rotest
class UpdateResourcesParamsModel(AbstractAPIModel):
    """Update the given resources test data.

    Args:
        descriptors (list): list of ResourceDescriptorModel.
            The resources to be updated.
        test_details (TestControlOperationParamsModel): the details of the
            relevant session datas.
    """
    PROPERTIES = [
        ArrayField(name="descriptors", items_type=ResourceDescriptorModel,
                   required=True),
        ModelField(name="test_details",
                   model=TestControlOperationParamsModel, required=True,
                   location="query")
    ]
示例#7
0
class FailureResponseModel(AbstractResponse):
    """Returns when an invalid request is received."""
    PROPERTIES = [
        StringField(name="details", required=True),
        ModelField(name="errors", model=GenericModel)
    ]