def test_load_games_entries_exist(self): warnings.simplefilter('ignore') board1 = chess.Board() board1.push_san("e4") board1.push_san("e5") game1 = Game() game1.board = board1 game1.player1 = FakeDiscordUser(id=1) game1.player2 = FakeDiscordUser(id=2) asyncio.run(game1.save()) board2 = chess.Board() board2.push_san("Nf3") game2 = Game() game2.board = board2 game2.player1 = FakeDiscordUser(id=2) game2.player2 = FakeDiscordUser(id=3) asyncio.run(game2.save()) game3 = Game() game3.board = chess.Board( 'rnbqkbnr/ppppp2p/8/5ppQ/4P3/2N5/PPPP1PPP/R1B1KBNR b KQkq - 0 1') game3.player1 = FakeDiscordUser(id=2) game3.player2 = FakeDiscordUser(id=3) game3.result = '1-0' asyncio.run(game3.save()) expected_games = [game1, game2] chess_bot = Chess() actual = asyncio.run(chess_bot.load_games()) self.assertListEqual(expected_games, actual)
def test_load_games_no_entries_exist(self): chess_bot = Chess() actual = asyncio.run(chess_bot.load_games()) self.assertEqual([], actual)