c9a12d8ac6a82f5bb7c10105cb277cac2354beca
[ric-app/qp-driver.git] / tests / conftest.py
1 import pytest
2
3
4 @pytest.fixture
5 def ue_metrics():
6     return {
7         "UEID": "12345",
8         "ServingCellID": "310-680-200-555002",
9         "MeasTimestampUEPDCPBytes": "2020-03-18 02:23:18.220",
10         "MeasPeriodUEPDCPBytes": 20,
11         "UEPDCPBytesDL": 250000,
12         "UEPDCPBytesUL": 100000,
13         "MeasTimestampUEPRBUsage": "2020-03-18 02:23:18.220",
14         "MeasPeriodUEPRBUsage": 20,
15         "UEPRBUsageDL": 10,
16         "UEPRBUsageUL": 30,
17         "MeasTimestampRF": "2020-03-18 02:23:18.210",
18         "MeasPeriodRF": 40,
19         "ServingCellRF": {"RSRP": -115, "RSRQ": -16, "RSSINR": -5},
20         "NeighborCellRF": [
21             {"CID": "310-680-200-555001", "CellRF": {"RSRP": -90, "RSRQ": -13, "RSSINR": -2.5}},
22             {"CID": "310-680-200-555003", "CellRF": {"RSRP": -140, "RSRQ": -17, "RSSINR": -6}},
23         ],
24         "FAKE_BAD_DATA_TEST": "THIS SHOULD GET DELETED",
25     }
26
27
28 @pytest.fixture
29 def ue_metrics_with_bad_cell():
30     return {
31         "UEID": "8675309",
32         "ServingCellID": "310-680-200-555002",
33         "MeasTimestampUEPDCPBytes": "2020-03-18 02:23:18.220",
34         "MeasPeriodUEPDCPBytes": 20,
35         "UEPDCPBytesDL": 250000,
36         "UEPDCPBytesUL": 100000,
37         "MeasTimestampUEPRBUsage": "2020-03-18 02:23:18.220",
38         "MeasPeriodUEPRBUsage": 20,
39         "UEPRBUsageDL": 10,
40         "UEPRBUsageUL": 30,
41         "MeasTimestampRF": "2020-03-18 02:23:18.210",
42         "MeasPeriodRF": 40,
43         "ServingCellRF": {"RSRP": -115, "RSRQ": -16, "RSSINR": -5},
44         "NeighborCellRF": [
45             {"CID": "310-680-200-555001", "CellRF": {"RSRP": -90, "RSRQ": -13, "RSSINR": -2.5}},
46             {"CID": "CANTTOUCHTHIS", "CellRF": {"RSRP": -140, "RSRQ": -17, "RSSINR": -6}},
47         ],
48     }
49
50
51 @pytest.fixture
52 def cell_metrics_1():
53     return {
54         "CellID": "310-680-200-555001",
55         "MeasTimestampPDCPBytes": "2020-03-18 02:23:18.220",
56         "MeasPeriodPDCPBytes": 20,
57         "PDCPBytesDL": 2000000,
58         "PDCPBytesUL": 1200000,
59         "MeasTimestampAvailPRB": "2020-03-18 02:23:18.220",
60         "MeasPeriodAvailPRB": 20,
61         "AvailPRBDL": 30,
62         "AvailPRBUL": 50,
63     }
64
65
66 @pytest.fixture
67 def cell_metrics_2():
68     return {
69         "CellID": "310-680-200-555002",
70         "MeasTimestampPDCPBytes": "2020-03-18 02:23:18.220",
71         "MeasPeriodPDCPBytes": 20,
72         "PDCPBytesDL": 800000,
73         "PDCPBytesUL": 400000,
74         "MeasTimestampAvailPRB": "2020-03-18 02:23:18.220",
75         "MeasPeriodAvailPRB": 20,
76         "AvailPRBDL": 30,
77         "AvailPRBUL": 45,
78         "FAKE_BAD_DATA_TEST": "THIS SHOULD GET DELETED",
79     }
80
81
82 @pytest.fixture
83 def cell_metrics_3():
84     return {
85         "CellID": "310-680-200-555003",
86         "MeasTimestampPDCPBytes": "2020-03-18 02:23:18.220",
87         "MeasPeriodPDCPBytes": 20,
88         "PDCPBytesDL": 1900000,
89         "PDCPBytesUL": 1000000,
90         "MeasTimestampAvailPRB": "2020-03-18 02:23:18.220",
91         "MeasPeriodAvailPRB": 20,
92         "AvailPRBDL": 60,
93         "AvailPRBUL": 80,
94     }
95
96
97 @pytest.fixture
98 def qpd_to_qp():
99     return {
100         "PredictionUE": "12345",
101         "UEMeasurements": {
102             "ServingCellID": "310-680-200-555002",
103             "MeasTimestampUEPDCPBytes": "2020-03-18 02:23:18.220",
104             "MeasPeriodUEPDCPBytes": 20,
105             "UEPDCPBytesDL": 250000,
106             "UEPDCPBytesUL": 100000,
107             "MeasTimestampUEPRBUsage": "2020-03-18 02:23:18.220",
108             "MeasPeriodUEPRBUsage": 20,
109             "UEPRBUsageDL": 10,
110             "UEPRBUsageUL": 30,
111         },
112         "CellMeasurements": [
113             {
114                 "CellID": "310-680-200-555001",
115                 "MeasTimestampPDCPBytes": "2020-03-18 02:23:18.220",
116                 "MeasPeriodPDCPBytes": 20,
117                 "PDCPBytesDL": 2000000,
118                 "PDCPBytesUL": 1200000,
119                 "MeasTimestampAvailPRB": "2020-03-18 02:23:18.220",
120                 "MeasPeriodAvailPRB": 20,
121                 "AvailPRBDL": 30,
122                 "AvailPRBUL": 50,
123                 "MeasTimestampRF": "2020-03-18 02:23:18.210",
124                 "MeasPeriodRF": 40,
125                 "RFMeasurements": {"RSRP": -90, "RSRQ": -13, "RSSINR": -2.5},
126             },
127             {
128                 "CellID": "310-680-200-555003",
129                 "MeasTimestampPDCPBytes": "2020-03-18 02:23:18.220",
130                 "MeasPeriodPDCPBytes": 20,
131                 "PDCPBytesDL": 1900000,
132                 "PDCPBytesUL": 1000000,
133                 "MeasTimestampAvailPRB": "2020-03-18 02:23:18.220",
134                 "MeasPeriodAvailPRB": 20,
135                 "AvailPRBDL": 60,
136                 "AvailPRBUL": 80,
137                 "MeasTimestampRF": "2020-03-18 02:23:18.210",
138                 "MeasPeriodRF": 40,
139                 "RFMeasurements": {"RSRP": -140, "RSRQ": -17, "RSSINR": -6},
140             },
141             {
142                 "CellID": "310-680-200-555002",
143                 "MeasTimestampPDCPBytes": "2020-03-18 02:23:18.220",
144                 "MeasPeriodPDCPBytes": 20,
145                 "PDCPBytesDL": 800000,
146                 "PDCPBytesUL": 400000,
147                 "MeasTimestampAvailPRB": "2020-03-18 02:23:18.220",
148                 "MeasPeriodAvailPRB": 20,
149                 "AvailPRBDL": 30,
150                 "AvailPRBUL": 45,
151                 "MeasTimestampRF": "2020-03-18 02:23:18.210",
152                 "MeasPeriodRF": 40,
153                 "RFMeasurements": {"RSRP": -115, "RSRQ": -16, "RSSINR": -5},
154             },
155         ],
156     }
157
158
159 @pytest.fixture
160 def qpd_to_qp_bad_cell():
161     return {
162         "PredictionUE": "8675309",
163         "UEMeasurements": {
164             "ServingCellID": "310-680-200-555002",
165             "MeasTimestampUEPDCPBytes": "2020-03-18 02:23:18.220",
166             "MeasPeriodUEPDCPBytes": 20,
167             "UEPDCPBytesDL": 250000,
168             "UEPDCPBytesUL": 100000,
169             "MeasTimestampUEPRBUsage": "2020-03-18 02:23:18.220",
170             "MeasPeriodUEPRBUsage": 20,
171             "UEPRBUsageDL": 10,
172             "UEPRBUsageUL": 30,
173         },
174         "CellMeasurements": [
175             {
176                 "CellID": "310-680-200-555001",
177                 "MeasTimestampPDCPBytes": "2020-03-18 02:23:18.220",
178                 "MeasPeriodPDCPBytes": 20,
179                 "PDCPBytesDL": 2000000,
180                 "PDCPBytesUL": 1200000,
181                 "MeasTimestampAvailPRB": "2020-03-18 02:23:18.220",
182                 "MeasPeriodAvailPRB": 20,
183                 "AvailPRBDL": 30,
184                 "AvailPRBUL": 50,
185                 "MeasTimestampRF": "2020-03-18 02:23:18.210",
186                 "MeasPeriodRF": 40,
187                 "RFMeasurements": {"RSRP": -90, "RSRQ": -13, "RSSINR": -2.5},
188             },
189             {
190                 "CellID": "310-680-200-555002",
191                 "MeasTimestampPDCPBytes": "2020-03-18 02:23:18.220",
192                 "MeasPeriodPDCPBytes": 20,
193                 "PDCPBytesDL": 800000,
194                 "PDCPBytesUL": 400000,
195                 "MeasTimestampAvailPRB": "2020-03-18 02:23:18.220",
196                 "MeasPeriodAvailPRB": 20,
197                 "AvailPRBDL": 30,
198                 "AvailPRBUL": 45,
199                 "MeasTimestampRF": "2020-03-18 02:23:18.210",
200                 "MeasPeriodRF": 40,
201                 "RFMeasurements": {"RSRP": -115, "RSRQ": -16, "RSSINR": -5},
202             },
203         ],
204     }