example_test.py 890 B

1234567891011121314151617181920212223242526272829
  1. from __future__ import print_function
  2. import os
  3. import sys
  4. try:
  5. import IDF
  6. except ImportError:
  7. test_fw_path = os.getenv('TEST_FW_PATH')
  8. if test_fw_path and test_fw_path not in sys.path:
  9. sys.path.insert(0, test_fw_path)
  10. import IDF
  11. @IDF.idf_example_test(env_tag='Example_WIFI')
  12. def test_examples_system_console(env, extra_data):
  13. dut = env.get_dut('console_example', 'examples/system/console', app_config_name='history')
  14. print("Using binary path: {}".format(dut.app.binary_path))
  15. dut.start_app()
  16. dut.expect("Command history enabled")
  17. env.close_dut(dut.name)
  18. dut = env.get_dut('console_example', 'examples/system/console', app_config_name='nohistory')
  19. print("Using binary path: {}".format(dut.app.binary_path))
  20. dut.start_app()
  21. dut.expect("Command history disabled")
  22. if __name__ == '__main__':
  23. test_examples_system_console()