Coverage for src/models/images.py: 100.00%

17 statements  

« prev     ^ index     » next       coverage.py v7.15.4, created at 2026-10-18 15:02 +0000

1#!/usr/bin/env python3 

2 

3# Standard libraries 

4from typing import List, Optional 

5 

6# Entrypoint type 

7Entrypoint = Optional[List[str] | str] 

8 

9# Image type 

10Image = str 

11 

12# Images class 

13class Images: 

14 

15 # Constants 

16 DOCKER_DIND_REGEX: str = r'.*docker:.*dind' 

17 LOCAL_IMAGE: str = 'local' 

18 LOCAL_QUIET_IMAGE: str = 'local:quiet' 

19 LOCAL_SILENT_IMAGE: str = 'local:silent' 

20 

21 # Host 

22 @staticmethod 

23 def host(image: str) -> bool: 

24 return image in [ 

25 Images.LOCAL_IMAGE, 

26 Images.LOCAL_QUIET_IMAGE, 

27 Images.LOCAL_SILENT_IMAGE, 

28 ] 

29 

30 # Quiet 

31 @staticmethod 

32 def quiet(image: str) -> bool: 

33 return image in [ 

34 Images.LOCAL_QUIET_IMAGE, 

35 Images.LOCAL_SILENT_IMAGE, 

36 ] 

37 

38 # Silent 

39 @staticmethod 

40 def silent(image: str) -> bool: 

41 return image in [ 

42 Images.LOCAL_SILENT_IMAGE, 

43 ]