def test_one(self): '''Allow 'composing' just 1 function''' assert compose(self.double)(2) == 4
def test_order(self): '''Compose in the right order''' assert compose(self.double, self.add)(2) == 2 * (2+1) assert compose(self.add, self.double)(2) == 1 + 2*2
def test_empty(self): '''When composing nothing, ValueError''' with pytest.raises(ValueError): compose()