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

etlt.condition.OrCondition.AndCondition.match()   A

Complexity

Conditions 3

Size

Total Lines 13
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 12

Importance

Changes 0
Metric Value
cc 3
eloc 5
nop 2
dl 0
loc 13
ccs 0
cts 5
cp 0
crap 12
rs 10
c 0
b 0
f 0
1
"""
2
ETLT
3
4
Copyright 2016 Set Based IT Consultancy
5
6
Licence MIT
7
"""
8
from etlt.condition.CompoundCondition import CompoundCondition
9
10
11
class AndCondition(CompoundCondition):
12
    """
13
    A condition or filter that match (i.e return True) if one  or more child conditions match the row.
14
    """
15
16
    # ------------------------------------------------------------------------------------------------------------------
17
    def match(self, row):
18
        """
19
        Returns True if the row matches one or more child conditions. Returns False otherwise.
20
21
        :param dict row: The row.
22
23
        :rtype: bool
24
        """
25
        for condition in self._conditions:
26
            if condition.match(row):
27
                return True
28
29
        return False
30
31
# ----------------------------------------------------------------------------------------------------------------------
32