Towards A1 v1.0.0
[ric-plt/a1.git] / tests / conftest.py
1 import pytest
2
3
4 @pytest.fixture
5 def adm_type_good():
6     return {
7         "name": "Admission Control",
8         "description": "various parameters to control admission of dual connection",
9         "policy_type_id": 20000,
10         "create_schema": {
11             "$schema": "http://json-schema.org/draft-07/schema#",
12             "type": "object",
13             "properties": {
14                 "enforce": {"type": "boolean", "default": True},
15                 "window_length": {
16                     "type": "integer",
17                     "default": 1,
18                     "minimum": 1,
19                     "maximum": 60,
20                     "description": "Sliding window length (in minutes)",
21                 },
22                 "blocking_rate": {
23                     "type": "number",
24                     "default": 10,
25                     "minimum": 1,
26                     "maximum": 100,
27                     "description": "% Connections to block",
28                 },
29                 "trigger_threshold": {
30                     "type": "integer",
31                     "default": 10,
32                     "minimum": 1,
33                     "description": "Minimum number of events in window to trigger blocking",
34                 },
35             },
36             "required": ["enforce", "blocking_rate", "trigger_threshold", "window_length"],
37             "additionalProperties": False,
38         },
39     }
40
41
42 @pytest.fixture
43 def adm_instance_good():
44     return {"enforce": True, "window_length": 10, "blocking_rate": 20, "trigger_threshold": 10}