docstr: ...Test that a parameter that exists in both C++ and Python is
  correctly linked
docstr_tok: ["...","Test","that","a","parameter","that","exists","in","both","C++","and","Python","is","correctly","linked"]
code: def test_cpp_setter(self):
      """...Test that a parameter that exists in both C++ and Python is
      correctly linked
      """
      # Test it works as expected with generic setter
      self.a0.cpp_int = 5
      self.assertEqual(self.a0.cpp_int, 5)
      self.assertEqual(self.a0._a0.get_cpp_int(), 5)
  
      # Test it works as expected with _set method
      self.a0._set("cpp_int", 15)
      self.assertEqual(self.a0.cpp_int, 15)
      self.assertEqual(self.a0._a0.get_cpp_int(), 15)
  
      # Test we raise correct error if setter was not a cpp method
      with self.assertRaisesRegex(
          NameError, "set_cpp_unlinked_int is not a method " "of.*"
      ):
          self.a0.cpp_unlinked_int = 3
  
      with self.assertRaisesRegex(
          NameError, "set_cpp_unlinked_int is not a method " "of.*"
      ):
          self.a0._set("cpp_unlinked_int", 3)
  
      # Test we raise correct error if _cpp_obj_name was not set
      del A0._cpp_obj_name
      with self.assertRaisesRegex(
          NameError,
          "_cpp_obj_name must be set as class "
          "attribute to use automatic C\+\+ setters",
      ):
          self.a0.cpp_int = 15
  
      with self.assertRaisesRegex(
          NameError,
          "_cpp_obj_name must be set as class "
          "attribute to use automatic C\+\+ setters",
      ):
          self.a0._set("cpp_int", 15)
  
imports: import sys
  import unittest
  from tick.base import Base
  from tick.base.build.base import A0
label_desc: Use image node_id 17 for calling the Test obj's underlying member method code with example usage: obj.test_cpp_setter() without return types