You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
570 B

  1. def test_constants():
  2. from pybind11_tests import some_constant
  3. assert some_constant == 14
  4. def test_function_overloading():
  5. from pybind11_tests import MyEnum, test_function
  6. assert test_function() == "test_function()"
  7. assert test_function(7) == "test_function(7)"
  8. assert test_function(MyEnum.EFirstEntry) == "test_function(enum=1)"
  9. assert test_function(MyEnum.ESecondEntry) == "test_function(enum=2)"
  10. def test_bytes():
  11. from pybind11_tests import return_bytes, print_bytes
  12. assert print_bytes(return_bytes()) == "bytes[1 0 2 0]"