X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fbindings%2Frmr-python%2Ftests%2Ftest_rmr.py;h=87b6c9469a9db00237298ee7fa358485017aca28;hb=fa09c30e9450c45853311c6f07a621e1b9218ff0;hp=6687c810853cf93577c6f530aec125b9a2b2b9e2;hpb=655515ed9a0e30acf5ae57333d5b7fd2d9fc6773;p=ric-plt%2Flib%2Frmr.git diff --git a/src/bindings/rmr-python/tests/test_rmr.py b/src/bindings/rmr-python/tests/test_rmr.py index 6687c81..87b6c94 100644 --- a/src/bindings/rmr-python/tests/test_rmr.py +++ b/src/bindings/rmr-python/tests/test_rmr.py @@ -1,4 +1,5 @@ -# ================================================================================== +# vim: ts=4 sw=4 expandtab: +# =================================================================================2 # Copyright (c) 2019 Nokia # Copyright (c) 2018-2019 AT&T Intellectual Property. # @@ -63,9 +64,24 @@ def _assert_new_sbuf(sbuf): def test_get_constants(expected_constants): """ - test getting constants + test getting constants. We don't care what values are returned as those + should be meaningful only to RMR. We do care that all of the constants + which are defined in expected_contents are returned. Further, we don't + consider it to be an error if the returned list has more constants than + what are in our list. + + To avoid frustration, this should list all missing keys, not fail on the + first missing key. """ - assert rmr._get_constants() == expected_constants + errors = 0 + econst = expected_constants + rconst = rmr._get_constants() + for key in econst: # test all expected constants + if key not in rconst: # expected value not listed by rmr + errors += 1 + print( "did not find required constant in list from RMR: %s" % key ) + + assert errors == 0 def test_get_mapping_dict(expected_states):