Coverage for portinvartija/portinvartija.py: 47.06%

17 statements  

« prev     ^ index     » next       coverage.py v7.4.1, created at 2024-02-04 21:36:56 +00:00

1# -*- coding: utf-8 -*- 

2# pylint: disable=expression-not-assigned,line-too-long 

3"""API of interface operations for data driven topics..""" 

4import os 

5import sys 

6from typing import List, Union 

7 

8import kdl # type: ignore 

9from first import first 

10 

11 

12def it_starts_with_silence() -> None: 

13 """Stub to bootstrap development and survive the make rounds before implementation is in place.""" 

14 assert os.getenv('DO_NOT_COMPLAIN_IF_THIS_IS_PRESENT_IN_YOUR_ENV', 'all good') == 'all good' # nosec B101 

15 assert sys.path > [] # nosec B101 

16 doc = kdl.Document() 

17 doc.append( 

18 kdl.Node( 

19 name='simple-name', 

20 properties=None, 

21 arguments=[123], 

22 children=[ 

23 kdl.Node( 

24 name='complex name here!', 

25 properties=None, 

26 arguments=None, 

27 children=None, 

28 ) 

29 ], 

30 ) 

31 ) 

32 ast = kdl.parse(doc) 

33 assert next(ast[0]) == 123 # nosec B101 

34 assert first((1, 2)) == 1 # nosec B101 

35 

36 

37def main(argv: Union[List[str], None] = None) -> int: 

38 argv = sys.argv[1:] if argv is None else argv 

39 return 0