example_test.py 873 B

1234567891011121314151617181920212223242526
  1. # This example code is in the Public Domain (or CC0 licensed, at your option.)
  2. # Unless required by applicable law or agreed to in writing, this
  3. # software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
  4. # CONDITIONS OF ANY KIND, either express or implied.
  5. # -*- coding: utf-8 -*-
  6. from __future__ import print_function, unicode_literals
  7. import re
  8. import ttfw_idf
  9. @ttfw_idf.idf_example_test(env_tag='Example_GENERIC')
  10. def test_examples_protocol_socket_non_block(env, _):
  11. dut = env.get_dut('non_blocking_socket', 'examples/protocols/sockets/non_blocking', dut_class=ttfw_idf.ESP32DUT)
  12. # start the test and expect the client to receive back it's original data
  13. dut.start_app()
  14. dut.expect(re.compile(r'nonblocking-socket-client: Received: GET / HTTP/1.1'), timeout=30)
  15. if __name__ == '__main__':
  16. test_examples_protocol_socket_non_block()