Coverage for /opt/conda/envs/apienv/lib/python3.10/site-packages/daiquiri/core/hardware/abstract/test.py: 0%
17 statements
« prev ^ index » next coverage.py v7.6.4, created at 2024-11-14 02:13 +0000
« prev ^ index » next coverage.py v7.6.4, created at 2024-11-14 02:13 +0000
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3from marshmallow import fields
5from daiquiri.core.hardware.abstract import HardwareObject
6from daiquiri.core.schema.hardware import HardwareSchema
7from daiquiri.core.schema.validators import OneOf
9import logging
11logger = logging.getLogger(__name__)
13TestStates = ["ON", "OFF", "UNKNOWN", "ERROR"]
16class TestPropertiesSchema(HardwareSchema):
17 state = OneOf(TestStates, metadata={"readOnly": True})
18 number = fields.Int()
19 string = fields.Str()
20 option = OneOf(["one", "two", "three"])
21 read_only = fields.Int(metadata={"readOnly": True})
24class Test(HardwareObject):
25 _type = "test"
26 _state_ok = [TestStates[0], TestStates[1]]
28 _properties = TestPropertiesSchema()