Flipper's latest version supports these kind of operators:
- __gt Greater than
- __gte Greater than or equal to
- __lt Less than
- __lte Less than or equal to
- __ne Not equals
- __in Set membership
- __not_in Set non-membership
However, a complex program may require extra or custom operators. The only way to add new operators are opening a pull-request or doing a hack:
from typing import Iterable
from flipper.conditions.operators.interface import AbstractOperator
from flipper.conditions.operators import Operator
class OverlapOperator(AbstractOperator):
SYMBOL = "overlap"
def compare(
self,
expected: Iterable,
actual: Iterable,
) -> bool:
return bool(set(expected) - set(actual)) is False
Operator.OPERATOR_MAP[OverlapOperator.SYMBOL] = OverlapOperator
I'll open a pull-request adding OverlapOperator. But I'd love to hear thoughts about being able to add custom operators for specific projects.
Flipper's latest version supports these kind of operators:
However, a complex program may require extra or custom operators. The only way to add new operators are opening a pull-request or doing a hack:
I'll open a pull-request adding OverlapOperator. But I'd love to hear thoughts about being able to add custom operators for specific projects.