Total Complexity | 2 |
Total Lines | 19 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | 1 | from abc import ABCMeta |
|
2 | |||
3 | |||
4 | 1 | class Exceptions: |
|
5 | |||
6 | 1 | def __init__(self, *exceptions): |
|
7 | 1 | kwargs = {e.__name__: e for e in exceptions} |
|
8 | 1 | self.TemplateNotFound = kwargs.get('TemplateNotFound', KeyError) |
|
9 | 1 | self.InvalidMaskedCode = kwargs.get('InvalidMaskedCode', ValueError) |
|
10 | 1 | self.FilenameTooLong = kwargs.get('FilenameTooLong', ValueError) |
|
11 | 1 | self.InvalidImageLink = kwargs.get('InvalidImageLink', ValueError) |
|
12 | |||
13 | |||
14 | 1 | class Service(metaclass=ABCMeta): |
|
15 | """Base class for domain services.""" |
||
16 | |||
17 | 1 | def __init__(self, exceptions=None): |
|
18 | self.exceptions = exceptions or Exceptions() |
||
19 |