diff options
author | 2023-11-14 15:26:41 +0100 | |
---|---|---|
committer | 2024-01-18 20:14:54 +0000 | |
commit | 77caeb1b193404e76beb27a1aa81321e8eb1cf1f (patch) | |
tree | bffb3aa51d53f96ad45a55d337f262260c191461 /src/vpp-api/python/vpp_papi/tests | |
parent | 87241fefd94423cdc50cfe6b1b54fec955b5f0d3 (diff) |
tests: preload api files
When sanity test is not done, API files are not loaded until the
first test case is run. Hence, it is not possible to use enums, etc.
outside of a test class.
By preloading API files before running any tests, it prevents its
issue.
Type: fix
Change-Id: I8730150374e6c5f8d6933ec037811372ac2a8da0
Signed-off-by: Maxime Peim <mpeim@cisco.com>
Diffstat (limited to 'src/vpp-api/python/vpp_papi/tests')
-rw-r--r-- | src/vpp-api/python/vpp_papi/tests/test_vpp_papi.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/vpp-api/python/vpp_papi/tests/test_vpp_papi.py b/src/vpp-api/python/vpp_papi/tests/test_vpp_papi.py index 2b21c83966a..51c024aa3ab 100644 --- a/src/vpp-api/python/vpp_papi/tests/test_vpp_papi.py +++ b/src/vpp-api/python/vpp_papi/tests/test_vpp_papi.py @@ -24,8 +24,7 @@ from vpp_papi import vpp_transport_shmem class TestVppPapiVPPApiClient(unittest.TestCase): def test_getcontext(self): - vpp_papi.VPPApiClient.apidir = "." - c = vpp_papi.VPPApiClient(testmode=True, use_socket=True) + c = vpp_papi.VPPApiClient(apidir=".", testmode=True, use_socket=True) # reset initialization at module load time. c.get_context.context = mp.Value(ctypes.c_uint, 0) @@ -39,8 +38,7 @@ class TestVppPapiVPPApiClientMp(unittest.TestCase): # run_tests.py (eg. make test TEST_JOBS=10) def test_get_context_mp(self): - vpp_papi.VPPApiClient.apidir = "." - c = vpp_papi.VPPApiClient(testmode=True, use_socket=True) + c = vpp_papi.VPPApiClient(apidir=".", testmode=True, use_socket=True) # reset initialization at module load time. c.get_context.context = mp.Value(ctypes.c_uint, 0) |