def test_single4(self): linq = Linq([1, 1, 2, 3, 5]) assert_equal(linq.single(cond_f=lambda x: x % 2 == 0), 2)
def test_single2(self): linq = Linq([]) linq.single()
def test_single3(self): linq = Linq([1, 2]) linq.single()
def test_single(self): linq = Linq([1]) assert_equal(linq.single(), 1) assert_equal(linq.single(), 1)