mirror of
https://github.com/esphome/esphome.git
synced 2026-10-06 19:06:37 +00:00
[core] Stop parent git repos from breaking ESP-IDF/PlatformIO builds (#16994)
This commit is contained in:
@@ -196,6 +196,33 @@ def test_is_ha_addon(monkeypatch, value, expected):
|
||||
assert actual == expected
|
||||
|
||||
|
||||
def test_add_git_ceiling_directory_sets_when_unset():
|
||||
"""An empty env gets GIT_CEILING_DIRECTORIES set to the directory."""
|
||||
env: dict[str, str] = {}
|
||||
directory = Path("/home/user/config")
|
||||
helpers.add_git_ceiling_directory(env, directory)
|
||||
assert env["GIT_CEILING_DIRECTORIES"] == str(directory)
|
||||
|
||||
|
||||
def test_add_git_ceiling_directory_appends_to_existing():
|
||||
"""An existing value is preserved and the new directory is appended."""
|
||||
env = {"GIT_CEILING_DIRECTORIES": str(Path("/some/ceiling"))}
|
||||
directory = Path("/home/user/config")
|
||||
helpers.add_git_ceiling_directory(env, directory)
|
||||
assert env["GIT_CEILING_DIRECTORIES"].split(os.pathsep) == [
|
||||
str(Path("/some/ceiling")),
|
||||
str(directory),
|
||||
]
|
||||
|
||||
|
||||
def test_add_git_ceiling_directory_skips_duplicate():
|
||||
"""A directory already in the list is not appended again."""
|
||||
directory = Path("/home/user/config")
|
||||
env = {"GIT_CEILING_DIRECTORIES": str(directory)}
|
||||
helpers.add_git_ceiling_directory(env, directory)
|
||||
assert env["GIT_CEILING_DIRECTORIES"] == str(directory)
|
||||
|
||||
|
||||
def test_walk_files(fixture_path):
|
||||
path = fixture_path / "helpers"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user