def test_calc_score(): assert calc_score((0,0,0,0), (0,0,0,0)) == (4,0) assert calc_score((1,2,3,4), (1,2,3,4)) == (4,0) assert calc_score((4,3,2,1), (1,2,3,4)) == (0,4) assert calc_score((1,1,0,0), (1,2,1,2)) == (1,1)
def __call__(self, guess): expected = self.guesses.pop(0) assert guess == expected return calc_score(guess, self.answer)