esp-idf/examples/storage/spiffs/pytest_spiffs_example.py

24 lines
790 B
Python
Raw Normal View History

2022-07-08 05:34:03 -04:00
# SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Unlicense OR CC0-1.0
import re
import pytest
from pytest_embedded import Dut
@pytest.mark.esp32
@pytest.mark.esp32c3
2024-04-03 06:10:43 -04:00
@pytest.mark.generic
2022-07-08 05:34:03 -04:00
def test_examples_spiffs(dut: Dut) -> None:
message_list = (rb'example: Initializing SPIFFS',
rb'example: Partition size: total: \d+, used: \d+',
rb'example: Opening file',
rb'example: File written',
rb'example: Renaming file',
rb'example: Reading file',
rb'example: Read from file: \'Hello World!\'',
rb'example: SPIFFS unmounted')
for msg in message_list:
dut.expect(re.compile(msg), timeout=60)