def test_k_list_constructor_copy(self): sample_list = [] k = K(sample_list, copy=True) sample_list.append(1) self.assertListEqual(sample_list, [1]) self.assertListEqual(k.execute('a'), [])
def test_k(self): self.assert_bender(K(1), {}, 1) self.assert_bender(K('string'), {}, 'string')
def __init__(self, condition, when_true=K(None), when_false=K(None)): self.condition = condition self.when_true = when_true self.when_false = when_false