Coverage for tests/unit_tests/scons/test_apio_env.py: 100%
11 statements
« prev ^ index » next coverage.py v7.16.1, created at 2026-09-23 03:53 +0000
« prev ^ index » next coverage.py v7.16.1, created at 2026-09-23 03:53 +0000
1"""
2Tests of the scons ApioEnv.
3"""
5from tests.unit_tests.scons.testing import make_test_apio_env
8def test_env_platform_id():
9 """Tests the env handling of the platform_id param."""
11 # -- Test with a non windows platform id.
12 env = make_test_apio_env(platform_id="darwin-arm64", is_windows=False)
13 assert not env.is_windows
15 # -- Test with a windows platform id.
16 env = make_test_apio_env(platform_id="windows-amd64", is_windows=True)
17 assert env.is_windows
20def test_targeting_one_if():
21 """Test the targeting_one_if() method."""
23 # -- The test env targets 'build'.
24 apio_env = make_test_apio_env()
26 assert apio_env.targeting_one_of("build")
27 assert apio_env.targeting_one_of("upload", "build")
28 assert not apio_env.targeting_one_of("upload")