def test_get_leader_board(self): # Arrange self.persist_leaderboard() expected = [{ "username": "******", "net_karma": 3 }, { "username": "******", "net_karma": 2 }, { "username": "******", "net_karma": 1 }] # Act leader_board = Karma.get_leader_board() # Assert self.assertEqual(expected, leader_board)
def execute(self, size: int = 3): return Karma.get_leader_board(size=size)