コード例 #1
0
ファイル: test_xoxo3.py プロジェクト: Marija7810/python
 def test_create_board(self):
     b = xoxo3.Board()
     d = b.create_board()
     assert d == [" "] * 9
コード例 #2
0
ファイル: test_xoxo3.py プロジェクト: Marija7810/python
 def test_play_again(self):
     b = xoxo3.Board()
     xoxo3.input = lambda pl_again: "Y"
     assert b.play_again() == "Y"
コード例 #3
0
ファイル: test_xoxo3.py プロジェクト: Marija7810/python
 def test_input(self):
     b = xoxo3.Board()
     player = "X"
     xoxo3.input = lambda choice: "3"
     assert b.input(player) == 3
コード例 #4
0
ファイル: test_xoxo3.py プロジェクト: Marija7810/python
 def test_is_tie(self, test_input, expected):
     b = xoxo3.Board()
     assert b.is_tie(test_input) == expected
コード例 #5
0
ファイル: test_xoxo3.py プロジェクト: Marija7810/python
 def test_is_winner(self, test_input, expected):
     b = xoxo3.Board()
     assert b.is_winner('x', test_input) == expected
コード例 #6
0
ファイル: test_xoxo3.py プロジェクト: Marija7810/python
 def test_who_first(self):
     b = xoxo3.Board()
     who_f = "X"
     xoxo3.input = lambda who_f: "X"
     assert b.who_first() == "X"
コード例 #7
0
ファイル: test_xoxo3.py プロジェクト: Marija7810/python
 def test_update_cell(self):
     b = xoxo3.Board()
     player = "x"
     c = b.create_board()
     xoxo3.input = lambda choice: "3"
     assert b.update_cell(3, player, c) == [" ", " ", " ", "x", " ", " ", " ", " ", " "]
コード例 #8
0
ファイル: test_xoxo3.py プロジェクト: Marija7810/python
 def test_display(self):
     b = xoxo3.Board()
     d = b.__init__()
     c = b.create_board()
     assert b.display(c) is 0