3019352ad8299b4ee1c4d56158a54bca3517d354
[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 # These are here just to reduce the size of the code in test_rmr so those (important) tests are more readable; in theory these dicts could be large
21 @pytest.fixture
22 def expected_constants():
23     return {
24         "RMR_MAX_XID": 32,
25         "RMR_MAX_SID": 32,
26         "RMR_MAX_MEID": 32,
27         "RMR_MAX_SRC": 64,
28         "RMR_MAX_RCV_BYTES": 4096,
29         "RMRFL_NONE": 0,
30         "RMRFL_AUTO_ALLOC": 3,
31         "RMR_DEF_SIZE": 0,
32         "RMR_VOID_MSGTYPE": -1,
33         "RMR_VOID_SUBID": -1,
34         "RMR_OK": 0,
35         "RMR_ERR_BADARG": 1,
36         "RMR_ERR_NOENDPT": 2,
37         "RMR_ERR_EMPTY": 3,
38         "RMR_ERR_NOHDR": 4,
39         "RMR_ERR_SENDFAILED": 5,
40         "RMR_ERR_CALLFAILED": 6,
41         "RMR_ERR_NOWHOPEN": 7,
42         "RMR_ERR_WHID": 8,
43         "RMR_ERR_OVERFLOW": 9,
44         "RMR_ERR_RETRY": 10,
45         "RMR_ERR_RCVFAILED": 11,
46         "RMR_ERR_TIMEOUT": 12,
47         "RMR_ERR_UNSET": 13,
48         "RMR_ERR_TRUNC": 14,
49         "RMR_ERR_INITFAILED": 15,
50     }
51
52
53 @pytest.fixture
54 def expected_states():
55     return {
56         0: "RMR_OK",
57         1: "RMR_ERR_BADARG",
58         2: "RMR_ERR_NOENDPT",
59         3: "RMR_ERR_EMPTY",
60         4: "RMR_ERR_NOHDR",
61         5: "RMR_ERR_SENDFAILED",
62         6: "RMR_ERR_CALLFAILED",
63         7: "RMR_ERR_NOWHOPEN",
64         8: "RMR_ERR_WHID",
65         9: "RMR_ERR_OVERFLOW",
66         10: "RMR_ERR_RETRY",
67         11: "RMR_ERR_RCVFAILED",
68         12: "RMR_ERR_TIMEOUT",
69         13: "RMR_ERR_UNSET",
70         14: "RMR_ERR_TRUNC",
71         15: "RMR_ERR_INITFAILED",
72     }