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

1#!/usr/bin/env python 

2# -*- coding: utf-8 -*- 

3from marshmallow import fields 

4 

5from daiquiri.core.hardware.abstract import HardwareObject 

6from daiquiri.core.schema.hardware import HardwareSchema 

7from daiquiri.core.schema.validators import OneOf 

8 

9import logging 

10 

11logger = logging.getLogger(__name__) 

12 

13TestStates = ["ON", "OFF", "UNKNOWN", "ERROR"] 

14 

15 

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}) 

22 

23 

24class Test(HardwareObject): 

25 _type = "test" 

26 _state_ok = [TestStates[0], TestStates[1]] 

27 

28 _properties = TestPropertiesSchema()