diff options
Diffstat (limited to 'lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp')
-rw-r--r-- | lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp b/lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp index 3502640c547..7abfb116c04 100644 --- a/lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp +++ b/lldb/unittests/ScriptInterpreter/Python/PythonDataObjectsTests.cpp @@ -382,3 +382,14 @@ TEST_F(PythonDataObjectsTest, TestPythonFile) PythonFile py_file(file, "r"); EXPECT_TRUE(PythonFile::Check(py_file.get())); } + +TEST_F(PythonDataObjectsTest, TestObjectAttributes) +{ + PythonInteger py_int(42); + EXPECT_TRUE(py_int.HasAttribute("numerator")); + EXPECT_FALSE(py_int.HasAttribute("this_should_not_exist")); + + PythonInteger numerator_attr = py_int.GetAttributeValue("numerator").AsType<PythonInteger>(); + EXPECT_TRUE(numerator_attr.IsAllocated()); + EXPECT_EQ(42, numerator_attr.GetInteger()); +}
\ No newline at end of file |