Skip to content

Commit

Permalink
test: add tests about recursively copying when work dir inside app dir
Browse files Browse the repository at this point in the history
  • Loading branch information
hfudev committed Nov 13, 2023
1 parent 4d091a4 commit 7b975bb
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/test_build.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0

import os
import shutil

import pytest
from conftest import (
create_project,
)

from idf_build_apps import (
build_apps,
find_apps,
)
from idf_build_apps.app import (
Expand Down Expand Up @@ -103,3 +109,19 @@ def test_idf_version_keywords_type():
assert isinstance(IDF_VERSION_MAJOR, int)
assert isinstance(IDF_VERSION_MINOR, int)
assert isinstance(IDF_VERSION_PATCH, int)


@pytest.mark.skipif(not shutil.which('idf.py'), reason='idf.py not found')
def test_work_dir_inside_relative_app_dir(tmp_path):
create_project('foo', tmp_path)

os.chdir(tmp_path / 'foo')
apps = find_apps(
'.',
'esp32',
work_dir=os.path.join('foo', 'bar'),
)
res = build_apps(apps)

assert len(apps) == 1
assert res == 0

0 comments on commit 7b975bb

Please sign in to comment.