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

1""" 

2Tests of the scons ApioEnv. 

3""" 

4 

5from tests.unit_tests.scons.testing import make_test_apio_env 

6 

7 

8def test_env_platform_id(): 

9 """Tests the env handling of the platform_id param.""" 

10 

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 

14 

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 

18 

19 

20def test_targeting_one_if(): 

21 """Test the targeting_one_if() method.""" 

22 

23 # -- The test env targets 'build'. 

24 apio_env = make_test_apio_env() 

25 

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")