esp-idf/examples/protocols/sockets/non_blocking/example_test.py
David Cermak 07de534191 examples: Move non-block socket examples to a single app
To simplify the examples, reused the boiler plate and statics and mainly
for testing on localhost interface with no physical network.
2021-06-25 20:46:49 +08:00

27 lines
873 B
Python

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