test_python_multiple_inheritance.py
Go to the documentation of this file.
1 # Adapted from:
2 # https://github.com/google/clif/blob/5718e4d0807fd3b6a8187dde140069120b81ecef/clif/testing/python/python_multiple_inheritance_test.py
3 from __future__ import annotations
4 
5 from pybind11_tests import python_multiple_inheritance as m
6 
7 
8 class PC(m.CppBase):
9  pass
10 
11 
12 class PPCC(PC, m.CppDrvd):
13  pass
14 
15 
16 def test_PC():
17  d = PC(11)
18  assert d.get_base_value() == 11
19  d.reset_base_value(13)
20  assert d.get_base_value() == 13
21 
22 
23 def test_PPCC():
24  d = PPCC(11)
25  assert d.get_drvd_value() == 33
26  d.reset_drvd_value(55)
27  assert d.get_drvd_value() == 55
28 
29  assert d.get_base_value() == 11
30  assert d.get_base_value_from_drvd() == 11
31  d.reset_base_value(20)
32  assert d.get_base_value() == 20
33  assert d.get_base_value_from_drvd() == 20
34  d.reset_base_value_from_drvd(30)
35  assert d.get_base_value() == 30
36  assert d.get_base_value_from_drvd() == 30
test_python_multiple_inheritance.PPCC
Definition: test_python_multiple_inheritance.py:12
test_python_multiple_inheritance.PC
Definition: test_python_multiple_inheritance.py:8
test_python_multiple_inheritance.test_PC
def test_PC()
Definition: test_python_multiple_inheritance.py:16
test_python_multiple_inheritance.test_PPCC
def test_PPCC()
Definition: test_python_multiple_inheritance.py:23


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:07:05