def test_user_counter_mul(): u1, u2 = {}, {} cnt_mul1 = session8.user_counter(session8.mul, u1) for i in range(10): cnt_mul1(4, 5) assert u1['mul'] == 10, "Check counter function" cnt_mul2 = session8.user_counter(session8.mul, u2) for i in range(8): cnt_mul2(4, 6) assert u2['mul'] == 8, "Check counter function"
def test_user_counter_div(): u1, u2 = {}, {} cnt_div1 = session8.user_counter(session8.div, u1) for i in range(10): cnt_div1(4, 5) assert u1['div'] == 10, "Check counter function" cnt_div2 = session8.user_counter(session8.div, u2) for i in range(8): cnt_div2(4, 6) assert u2['div'] == 8, "Check counter function"
def test_user_counter_add(): u1, u2 = {}, {} cnt_add1 = session8.user_counter(session8.add, u1) for i in range(10): cnt_add1(4, 5) assert u1['add'] == 10, "Check counter function" cnt_add2 = session8.user_counter(session8.add, u2) for i in range(8): cnt_add2(4, 6) assert u2['add'] == 8, "Check counter function"