Coverage for structured_tutorials / errors.py: 100%

10 statements  

« prev     ^ index     » next       coverage.py v7.13.0, created at 2025-12-22 14:45 +0100

1# Copyright (c) 2025 Mathias Ertl 

2# Licensed under the MIT License. See LICENSE file for details. 

3 

4"""Collection of errors thrown by this project.""" 

5 

6 

7class StructuredTutorialError(Exception): 

8 """Base class for all exceptions thrown by this project.""" 

9 

10 

11class RunTutorialException(StructuredTutorialError): 

12 """Exception that is raised when we capture an exception while running (and not yet cleaning up).""" 

13 

14 

15class InvalidAlternativesSelectedError(StructuredTutorialError): 

16 """Exception raised when an invalid alternative is selected.""" 

17 

18 

19class PartError(StructuredTutorialError): 

20 """Base class for all errors happening in a specific part.""" 

21 

22 

23class CommandsPartError(PartError): 

24 """Base class for all errors happening in a specific commands part.""" 

25 

26 

27class CommandTestError(CommandsPartError): 

28 """Base class for exceptions when a test for a command fails.""" 

29 

30 

31class CommandOutputTestError(CommandTestError): 

32 """Exception raised when an output test fails.""" 

33 

34 

35class FilePartError(PartError): 

36 """Exception raised for errors in file parts.""" 

37 

38 

39class DestinationIsADirectoryError(FilePartError): 

40 """Exception raised when a destination is a directory.""" 

41 

42 

43class PromptNotConfirmedError(PartError): 

44 """Exception raised when a user does not confirm the current state in a prompt part."""