Coverage for pystratum_cli/command/StratumCommand.py: 82%

22 statements  

« prev     ^ index     » next       coverage.py v7.2.7, created at 2024-05-12 12:02 +0200

1from pystratum_cli.command.BaseCommand import BaseCommand 

2 

3 

4class StratumCommand(BaseCommand): 

5 """ 

6 The stratum command: combination of constants, loader, and wrapper commands. 

7 

8 stratum 

9 {config_file : The stratum configuration file} 

10 """ 

11 

12 # ------------------------------------------------------------------------------------------------------------------ 

13 def handle(self) -> int: 

14 """ 

15 Executes constants command when StratumCommand is activated. 

16 """ 

17 self._read_config_file(self.input) 

18 

19 factory = self._create_backend_factory() 

20 

21 worker = factory.create_constant_worker(self._config, self._io) 

22 if worker: 

23 ret = worker.execute() 

24 

25 if ret != 0: 25 ↛ 26line 25 didn't jump to line 26, because the condition on line 25 was never true

26 return ret 

27 

28 worker = factory.create_routine_loader_worker(self._config, self._io) 

29 if worker: 

30 ret = worker.execute() 

31 

32 if ret != 0: 32 ↛ 33line 32 didn't jump to line 33, because the condition on line 32 was never true

33 return ret 

34 

35 worker = factory.create_routine_wrapper_generator_worker(self._config, self._io) 

36 if worker: 

37 ret = worker.execute() 

38 

39 if ret != 0: 39 ↛ 40line 39 didn't jump to line 40, because the condition on line 39 was never true

40 return ret 

41 

42 self._io.write('') 

43 

44 return 0 

45 

46# ----------------------------------------------------------------------------------------------------------------------