X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fbindings%2Frmr-python%2Ftests%2Fconftest.py;fp=src%2Fbindings%2Frmr-python%2Ftests%2Fconftest.py;h=3019352ad8299b4ee1c4d56158a54bca3517d354;hb=0b6077fcd74759b097964d49ccb57e36bd86f9bb;hp=51ddda9cade980012104492f9b61f501bac2ee4e;hpb=6c13481ce6bf6d86a370bf335f1f7e70d349c933;p=ric-plt%2Flib%2Frmr.git diff --git a/src/bindings/rmr-python/tests/conftest.py b/src/bindings/rmr-python/tests/conftest.py index 51ddda9..3019352 100644 --- a/src/bindings/rmr-python/tests/conftest.py +++ b/src/bindings/rmr-python/tests/conftest.py @@ -17,51 +17,56 @@ import pytest +# 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 @pytest.fixture -def fake_consts(): - return {"RMR_MAX_XID": 32, - "RMR_MAX_SID": 32, - "RMR_MAX_MEID": 32, - "RMR_MAX_SRC": 64, - "RMR_MAX_RCV_BYTES": 4096, - "RMRFL_NONE": 0, - "RMRFL_AUTO_ALLOC": 1, - "RMR_DEF_SIZE": 0, - "RMR_VOID_MSGTYPE": -1, - "RMR_VOID_SUBID": -1, - "RMR_OK": 0, - "RMR_ERR_BADARG": 1, - "RMR_ERR_NOENDPT": 2, - "RMR_ERR_EMPTY": 3, - "RMR_ERR_NOHDR": 4, - "RMR_ERR_SENDFAILED": 5, - "RMR_ERR_CALLFAILED": 6, - "RMR_ERR_NOWHOPEN": 7, - "RMR_ERR_WHID": 8, - "RMR_ERR_OVERFLOW": 9, - "RMR_ERR_RETRY": 10, - "RMR_ERR_RCVFAILED": 11, - "RMR_ERR_TIMEOUT": 12, - "RMR_ERR_UNSET": 13, - "RMR_ERR_TRUNC": 14, - "RMR_ERR_INITFAILED": 15} +def expected_constants(): + return { + "RMR_MAX_XID": 32, + "RMR_MAX_SID": 32, + "RMR_MAX_MEID": 32, + "RMR_MAX_SRC": 64, + "RMR_MAX_RCV_BYTES": 4096, + "RMRFL_NONE": 0, + "RMRFL_AUTO_ALLOC": 3, + "RMR_DEF_SIZE": 0, + "RMR_VOID_MSGTYPE": -1, + "RMR_VOID_SUBID": -1, + "RMR_OK": 0, + "RMR_ERR_BADARG": 1, + "RMR_ERR_NOENDPT": 2, + "RMR_ERR_EMPTY": 3, + "RMR_ERR_NOHDR": 4, + "RMR_ERR_SENDFAILED": 5, + "RMR_ERR_CALLFAILED": 6, + "RMR_ERR_NOWHOPEN": 7, + "RMR_ERR_WHID": 8, + "RMR_ERR_OVERFLOW": 9, + "RMR_ERR_RETRY": 10, + "RMR_ERR_RCVFAILED": 11, + "RMR_ERR_TIMEOUT": 12, + "RMR_ERR_UNSET": 13, + "RMR_ERR_TRUNC": 14, + "RMR_ERR_INITFAILED": 15, + } @pytest.fixture def expected_states(): - return {0: "RMR_OK", - 1: "RMR_ERR_BADARG", - 2: "RMR_ERR_NOENDPT", - 3: "RMR_ERR_EMPTY", - 4: "RMR_ERR_NOHDR", - 5: "RMR_ERR_SENDFAILED", - 6: "RMR_ERR_CALLFAILED", - 7: "RMR_ERR_NOWHOPEN", - 8: "RMR_ERR_WHID", - 9: "RMR_ERR_OVERFLOW", - 10: "RMR_ERR_RETRY", - 11: "RMR_ERR_RCVFAILED", - 12: "RMR_ERR_TIMEOUT", - 13: "RMR_ERR_UNSET", - 14: "RMR_ERR_TRUNC", - 15: "RMR_ERR_INITFAILED"} + return { + 0: "RMR_OK", + 1: "RMR_ERR_BADARG", + 2: "RMR_ERR_NOENDPT", + 3: "RMR_ERR_EMPTY", + 4: "RMR_ERR_NOHDR", + 5: "RMR_ERR_SENDFAILED", + 6: "RMR_ERR_CALLFAILED", + 7: "RMR_ERR_NOWHOPEN", + 8: "RMR_ERR_WHID", + 9: "RMR_ERR_OVERFLOW", + 10: "RMR_ERR_RETRY", + 11: "RMR_ERR_RCVFAILED", + 12: "RMR_ERR_TIMEOUT", + 13: "RMR_ERR_UNSET", + 14: "RMR_ERR_TRUNC", + 15: "RMR_ERR_INITFAILED", + }