Coverage for tests/unit_tests/utils/test_apio_platforms.py: 100%

7 statements  

« prev     ^ index     » next       coverage.py v7.15.4, created at 2026-08-09 01:55 +0000

1""" 

2Tests of apio_platforms.py 

3""" 

4 

5from apio.utils import apio_platforms 

6 

7 

8def test_platforms(): 

9 """Sanity check the platforms list""" 

10 

11 # pylint: disable=protected-access 

12 

13 # -- Get the (private) platform definitions list 

14 platforms_list = apio_platforms._SUPPORTED_PLATFORMS 

15 

16 # -- Get the dict of ApioPlatform 

17 platforms_dict = apio_platforms.get_all_apio_platforms() 

18 

19 # -- Sanity check, sizes should be the same. 

20 assert len(platforms_list) == len(platforms_dict) 

21 

22 # -- Test each ApioPlatform 

23 for platform_id, platform in platforms_dict.items(): 

24 

25 # -- The key should match the object's id field. 

26 assert platform_id == platform.id 

27 

28 # -- NOTE: Additional assertions are implemented in the ApioPlatform 

29 # -- class itself.