linting ...
[oam.git] / code / network-generator / tests / test_type_definitions.py
1 # Copyright 2023 highstreet technologies GmbH
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #     http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 from network_generation.model.python.countries import Country
16 from network_generation.model.python.type_definitions import (
17     AdministrativeState,
18     AddressType,
19     AlarmState,
20     LifeCycleState,
21     OperationalState,
22     UsageState,
23     Utilization,
24 )
25
26
27 def test_type_definitions() -> None:
28     administrative_state: AdministrativeState = AdministrativeState.LOCKED
29     assert administrative_state.name == "LOCKED"
30
31     address_type: AddressType = {
32         "street": "Hähnelstraße 6",
33         "building": "b001",
34         "room": "EG rechts",
35         "city": "Berlin",
36         "zip": "12159",
37         "state": "Berlin",
38         "country": Country.Germany,
39     }
40     assert (
41         str(address_type)
42         == "{'street': 'Hähnelstraße 6', 'building': 'b001', "
43         + "'room': 'EG rechts', 'city': 'Berlin', 'zip': '12159', "
44         + "'state': 'Berlin', 'country': <Country.Germany: 'Germany'>}"
45     )
46
47     alarm_state: AlarmState = 1
48     assert alarm_state == 1
49
50     life_cycle_state: LifeCycleState = LifeCycleState.PLANNED
51     assert str(life_cycle_state.name) == "PLANNED"
52
53     operational_state: OperationalState = OperationalState.ENABLED
54     assert str(operational_state.name) == "ENABLED"
55
56     usage_state: UsageState = UsageState.UNUSED
57     assert str(usage_state.name) == "UNUSED"
58
59     utilization: Utilization = 1
60     assert utilization == 1