OptimizationStatus.__eq__()   A
last analyzed

Complexity

Conditions 2

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
c 0
b 0
f 0
dl 0
loc 4
ccs 4
cts 4
cp 1
crap 2
rs 10
1
"""Describe status of optimization."""
2 1
from enum import Enum
3
4
5 1
class OptimizationStatus(Enum):
6
    """Enum for describing status of optimization.
7
    not_started - nothing was optimized yet
8
    in_progress - optimization is in progress
9
    success - optimization successfully completed
10
    failed - optimization couldn't be done
11
    """
12 1
    not_started = "Not started"
13 1
    success = "Success"
14 1
    in_progress = "In progress"
15 1
    failed = "Failed"
16
17 1
    def __eq__(self, other):
18 1
        if other is None:
19 1
            return False
20
        return self.value == other.value
21