Coverage for oarepo_c4gh/crypt4gh/common/header.py: 100%

11 statements  

« prev     ^ index     » next       coverage.py v7.10.2, created at 2025-08-07 12:05 +0000

1"""Protocol for header implementation. 

2 

3""" 

4 

5from typing import Protocol, abstractmethod 

6 

7 

8class Header(Protocol): 

9 """This is a protocol class which guarantees that a header packets 

10 collection is available by its descendants. The properties 

11 provided are a list of packets - both readable and unreadable - 

12 and header metadata fields magic_bytes and version. 

13 

14 """ 

15 

16 @property 

17 @abstractmethod 

18 def packets(self) -> list: 

19 """Must return original or transformed list of header packets.""" 

20 ... 

21 

22 @property 

23 @abstractmethod 

24 def magic_bytes(self) -> bytes: 

25 """Must return the original magic bytes.""" 

26 ... 

27 

28 @property 

29 @abstractmethod 

30 def version(self) -> int: 

31 """Must return the version of the loaded/transformer 

32 container. Must always return 1. 

33 

34 """ 

35 ...