Files
clang-p2996/lldb/test/API/python_api/sblaunchinfo/TestSBLaunchInfo.py
Jonas Devlieghere 80fcecb13c [lldb] Replace assertEquals with assertEqual (NFC) (#82073)
assertEquals is a deprecated alias for assertEqual and has been removed
in Python 3.12. This wasn't an issue previously because we used a
vendored version of the unittest module. Now that we use the built-in
version this gets updated together with the Python version used to run
the test suite.
2024-02-16 20:58:50 -08:00

29 lines
791 B
Python

"""
Test SBLaunchInfo
"""
from lldbsuite.test.lldbtest import *
def lookup(info, key):
for i in range(info.GetNumEnvironmentEntries()):
KeyEqValue = info.GetEnvironmentEntryAtIndex(i)
Key, Value = KeyEqValue.split("=")
if Key == key:
return Value
return ""
class TestSBLaunchInfo(TestBase):
NO_DEBUG_INFO_TESTCASE = True
def test_environment_getset(self):
info = lldb.SBLaunchInfo(None)
info.SetEnvironmentEntries(["FOO=BAR"], False)
self.assertEqual(1, info.GetNumEnvironmentEntries())
info.SetEnvironmentEntries(["BAR=BAZ"], True)
self.assertEqual(2, info.GetNumEnvironmentEntries())
self.assertEqual("BAR", lookup(info, "FOO"))
self.assertEqual("BAZ", lookup(info, "BAR"))