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

26 lines
810 B
Python
Raw Normal View History

2025-02-24 10:18:03 +08:00
# SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
2022-07-08 11:34:03 +02:00
# SPDX-License-Identifier: Unlicense OR CC0-1.0
import re
import pytest
from pytest_embedded import Dut
2025-02-24 10:18:03 +08:00
from pytest_embedded_idf.utils import idf_parametrize
2022-07-08 11:34:03 +02:00
2024-04-03 18:10:43 +08:00
@pytest.mark.generic
2025-02-24 10:18:03 +08:00
@idf_parametrize('target', ['esp32', 'esp32c3'], indirect=['target'])
2022-07-08 11:34:03 +02:00
def test_examples_spiffs(dut: Dut) -> None:
2025-02-24 10:18:03 +08:00
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',
)
2022-07-08 11:34:03 +02:00
for msg in message_list:
dut.expect(re.compile(msg), timeout=60)