def test_evalute_alternatives_dict(): a = { False: 'foo', True: 'bar' } result = evalute_alternatives(a) assert result == ['bar']
def test_evalute_alternatives(): a1 = Alternative(lambda: False) a2 = Alternative(lambda: True) a3 = Alternative(lambda: True) a = { # order is important for test, usualy dict is also ok a1: ['foo', 'bar'], a2: 'bar', a3: ['foo1', 'bar1'], } result = evalute_alternatives(a) assert compare(result, ['bar', ['foo1', 'bar1']]) # order is not important
def test_evalute_alternatives_tuple(): a = ('foo', 'bar') assert evalute_alternatives(a) is a
def test_evalute_alternatives_list(): a = ['foo', 'bar'] assert evalute_alternatives(a) is a