Passed
Branch master (17b603)
by P.R.
01:31
created

etlt.condition.Condition   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 27
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A Condition.match() 0 10 1
1
"""
2
ETLT
3
4
Copyright 2016 Set Based IT Consultancy
5
6
Licence MIT
7
"""
8 1
import abc
9
10
11 1
class Condition(metaclass=abc.ABCMeta):
12
    """
13
    An abstract parent class for conditions.
14
    """
15
16
    # ------------------------------------------------------------------------------------------------------------------
17 1
    @abc.abstractmethod
18 1
    def match(self, row):
19
        """
20
        Returns True if the row matches this condition. Returns False otherwise.
21
22
        :param dict row: The row.
23
24
        :rtype: bool
25
        """
26
        raise NotImplementedError()
27
28
# ----------------------------------------------------------------------------------------------------------------------
29