Пример #1
0
def empty_condition():
    return DiscreteCondition()
Пример #2
0
 def test_iter(self, mock_elem):
     condition = DiscreteCondition.from_elem_args(mock_elem)
     elems = []
     for elem in condition:
         elems.append(elem)
     assert elems == [mock_elem]
Пример #3
0
 def test_getitem_neg_index(self, mock_elem):
     condition = DiscreteCondition.from_elem_args(mock_elem)
     assert condition[-1] == mock_elem
Пример #4
0
 def test_ne_pos_case(self, make_mock_elem):
     elem = make_mock_elem()
     condition = DiscreteCondition.from_elem_args(elem)
     diff_elem = make_mock_elem()
     diff_condition = DiscreteCondition.from_elem_args(diff_elem)
     assert condition != diff_condition
Пример #5
0
 def test_eq_pos_case(self, make_mock_elem):
     elem = make_mock_elem()
     condition = DiscreteCondition.from_elem_args(elem)
     same_condition = DiscreteCondition.from_elem_args(elem)
     assert condition == same_condition
Пример #6
0
 def test_append(self, mock_elem):
     condition = DiscreteCondition.from_elem_args(mock_elem)
     assert condition._elems[-1] == mock_elem
Пример #7
0
def one_elem_condition(mock_elem):
    return DiscreteCondition.from_elem_args(mock_elem)