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.

58 lines
1.7 KiB

  1. #!/usr/bin/env python
  2. from __future__ import print_function
  3. import sys
  4. sys.path.append('.')
  5. from example import test_function
  6. from example import some_constant
  7. from example import EMyEnumeration
  8. from example import EFirstEntry
  9. from example import Example4
  10. from example import return_bytes
  11. from example import print_bytes
  12. print(EMyEnumeration)
  13. print(EMyEnumeration.EFirstEntry)
  14. print(EMyEnumeration.ESecondEntry)
  15. print(EFirstEntry)
  16. print(test_function())
  17. print(test_function(7))
  18. print(test_function(EMyEnumeration.EFirstEntry))
  19. print(test_function(EMyEnumeration.ESecondEntry))
  20. print("enum->integer = %i" % int(EMyEnumeration.ESecondEntry))
  21. print("integer->enum = %s" % str(EMyEnumeration(2)))
  22. print("A constant = " + str(some_constant))
  23. print(Example4.EMode)
  24. print(Example4.EMode.EFirstMode)
  25. print(Example4.EFirstMode)
  26. Example4.test_function(Example4.EFirstMode)
  27. print("Equality test 1: " + str(
  28. Example4.test_function(Example4.EFirstMode) ==
  29. Example4.test_function(Example4.EFirstMode)))
  30. print("Inequality test 1: " + str(
  31. Example4.test_function(Example4.EFirstMode) !=
  32. Example4.test_function(Example4.EFirstMode)))
  33. print("Equality test 2: " + str(
  34. Example4.test_function(Example4.EFirstMode) ==
  35. Example4.test_function(Example4.ESecondMode)))
  36. print("Inequality test 2: " + str(
  37. Example4.test_function(Example4.EFirstMode) !=
  38. Example4.test_function(Example4.ESecondMode)))
  39. x = {
  40. Example4.test_function(Example4.EFirstMode): 1,
  41. Example4.test_function(Example4.ESecondMode): 2
  42. }
  43. x[Example4.test_function(Example4.EFirstMode)] = 3
  44. x[Example4.test_function(Example4.ESecondMode)] = 4
  45. print("Hashing test = " + str(x))
  46. print_bytes(return_bytes())