51ddda9cade980012104492f9b61f501bac2ee4e
[ric-plt/lib/rmr.git] / src / bindings / rmr-python / tests / conftest.py
1 # ==================================================================================
2 #       Copyright (c) 2019 Nokia
3 #       Copyright (c) 2018-2019 AT&T Intellectual Property.
4 #
5 #   Licensed under the Apache License, Version 2.0 (the "License");
6 #   you may not use this file except in compliance with the License.
7 #   You may obtain a copy of the License at
8 #
9 #          http://www.apache.org/licenses/LICENSE-2.0
10 #
11 #   Unless required by applicable law or agreed to in writing, software
12 #   distributed under the License is distributed on an "AS IS" BASIS,
13 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 #   See the License for the specific language governing permissions and
15 #   limitations under the License.
16 # ==================================================================================
17 import pytest
18
19
20 @pytest.fixture
21 def fake_consts():
22     return {"RMR_MAX_XID": 32,
23             "RMR_MAX_SID": 32,
24             "RMR_MAX_MEID": 32,
25             "RMR_MAX_SRC": 64,
26             "RMR_MAX_RCV_BYTES": 4096,
27             "RMRFL_NONE": 0,
28             "RMRFL_AUTO_ALLOC": 1,
29             "RMR_DEF_SIZE": 0,
30             "RMR_VOID_MSGTYPE": -1,
31             "RMR_VOID_SUBID": -1,
32             "RMR_OK": 0,
33             "RMR_ERR_BADARG": 1,
34             "RMR_ERR_NOENDPT": 2,
35             "RMR_ERR_EMPTY": 3,
36             "RMR_ERR_NOHDR": 4,
37             "RMR_ERR_SENDFAILED": 5,
38             "RMR_ERR_CALLFAILED": 6,
39             "RMR_ERR_NOWHOPEN": 7,
40             "RMR_ERR_WHID": 8,
41             "RMR_ERR_OVERFLOW": 9,
42             "RMR_ERR_RETRY": 10,
43             "RMR_ERR_RCVFAILED": 11,
44             "RMR_ERR_TIMEOUT": 12,
45             "RMR_ERR_UNSET": 13,
46             "RMR_ERR_TRUNC": 14,
47             "RMR_ERR_INITFAILED": 15}
48
49
50 @pytest.fixture
51 def expected_states():
52     return {0: "RMR_OK",
53             1: "RMR_ERR_BADARG",
54             2: "RMR_ERR_NOENDPT",
55             3: "RMR_ERR_EMPTY",
56             4: "RMR_ERR_NOHDR",
57             5: "RMR_ERR_SENDFAILED",
58             6: "RMR_ERR_CALLFAILED",
59             7: "RMR_ERR_NOWHOPEN",
60             8: "RMR_ERR_WHID",
61             9: "RMR_ERR_OVERFLOW",
62             10: "RMR_ERR_RETRY",
63             11: "RMR_ERR_RCVFAILED",
64             12: "RMR_ERR_TIMEOUT",
65             13: "RMR_ERR_UNSET",
66             14: "RMR_ERR_TRUNC",
67             15: "RMR_ERR_INITFAILED"}