From dba0a9b2153f4f083ccd34ccc1fcfad76cbeca64 Mon Sep 17 00:00:00 2001 From: "igor.udot" Date: Tue, 7 Jan 2025 16:24:45 +0800 Subject: [PATCH] test: moved test to esp_bool_parser --- tests/test_manifest.py | 20 -------------------- tests/test_utils.py | 16 +--------------- 2 files changed, 1 insertion(+), 35 deletions(-) diff --git a/tests/test_manifest.py b/tests/test_manifest.py index 7b8041d..2a7e6db 100644 --- a/tests/test_manifest.py +++ b/tests/test_manifest.py @@ -4,10 +4,6 @@ import pytest import yaml -from esp_bool_parser import parse_bool_expr -from packaging.version import ( - Version, -) import idf_build_apps from idf_build_apps import setup_logging @@ -509,14 +505,6 @@ def test_manifest_diff_sha(tmp_path, sha_of_enable_only_esp32): class TestIfParser: - def test_idf_version(self, monkeypatch): - monkeypatch.setattr(idf_build_apps.manifest.if_parser, 'IDF_VERSION', Version('5.9.0')) - statement = 'IDF_VERSION > "5.10.0"' - assert parse_bool_expr(statement).get_value('esp32', 'foo') is False - - statement = 'IDF_VERSION in ["5.9.0"]' - assert parse_bool_expr(statement).get_value('esp32', 'foo') is True - def test_invalid_if_statement(self): statement = '1' with pytest.raises(InvalidIfClause, match='Invalid if clause: 1'): @@ -525,11 +513,3 @@ def test_invalid_if_statement(self): def test_temporary_must_with_reason(self): with pytest.raises(InvalidIfClause, match='"reason" must be set when "temporary: true"'): IfClause(stmt='IDF_TARGET == "esp32"', temporary=True) - - -def test_consecutive_or_and_stml_manifest(): - with pytest.raises(InvalidIfClause, match='Chaining "and"/"or" is not allowed'): - IfClause(stmt='IDF_TARGET == "esp32" or IDF_TARGET == "esp32c3" or IDF_TARGET == "esp32s3"') - - with pytest.raises(InvalidIfClause, match='Chaining "and"/"or" is not allowed'): - IfClause(stmt='IDF_TARGET == "esp32" or IDF_TARGET == "esp32c3" and IDF_TARGET == "esp32s3"') diff --git a/tests/test_utils.py b/tests/test_utils.py index 0302faf..87c137b 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -1,7 +1,6 @@ -# SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD +# SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: Apache-2.0 import os -import shutil from pathlib import ( Path, ) @@ -143,16 +142,3 @@ def test_files_matches_patterns(tmp_path): os.chdir(temp_dir) for f in matched_files: assert files_matches_patterns(f, abs_pat) - - -@pytest.mark.skipif(not shutil.which('idf.py'), reason='idf.py not found') -def test_idf_version_keywords_type(): - from idf_build_apps.constants import ( - IDF_VERSION_MAJOR, - IDF_VERSION_MINOR, - IDF_VERSION_PATCH, - ) - - assert isinstance(IDF_VERSION_MAJOR, int) - assert isinstance(IDF_VERSION_MINOR, int) - assert isinstance(IDF_VERSION_PATCH, int)