Skip to content

Commit 8a4b603

Browse files
committed
use assertSetEqual() consistently
1 parent 441d59c commit 8a4b603

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

exercises/go-counting/go_counting_test.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,25 @@ def test_black_corner_territory_on_5x5_board(self):
1818
board = go_counting.Board(board5x5)
1919
stone, territory = board.territory(x=0, y=1)
2020
self.assertEqual(stone, go_counting.BLACK)
21-
self.assertEqual(territory, {(0, 0), (0, 1), (1, 0)})
21+
self.assertSetEqual(territory, {(0, 0), (0, 1), (1, 0)})
2222

2323
def test_white_center_territory_on_5x5_board(self):
2424
board = go_counting.Board(board5x5)
2525
stone, territory = board.territory(x=2, y=3)
2626
self.assertEqual(stone, go_counting.WHITE)
27-
self.assertEqual(territory, {(2, 3)})
27+
self.assertSetEqual(territory, {(2, 3)})
2828

2929
def test_open_corner_territory_on_5x5_board(self):
3030
board = go_counting.Board(board5x5)
3131
stone, territory = board.territory(x=1, y=4)
3232
self.assertEqual(stone, go_counting.NONE)
33-
self.assertEqual(territory, {(0, 3), (0, 4), (1, 4)})
33+
self.assertSetEqual(territory, {(0, 3), (0, 4), (1, 4)})
3434

3535
def test_a_stone_and_not_a_territory_on_5x5_board(self):
3636
board = go_counting.Board(board5x5)
3737
stone, territory = board.territory(x=1, y=1)
3838
self.assertEqual(stone, go_counting.NONE)
39-
self.assertEqual(territory, set())
39+
self.assertSetEqual(territory, set())
4040

4141
def test_invalid_because_x_is_too_low(self):
4242
board = go_counting.Board(board5x5)
@@ -72,17 +72,17 @@ def test_two_territories_rectangular_board(self):
7272
]
7373
board = go_counting.Board(input_board)
7474
territories = board.territories()
75-
self.assertEqual(territories[go_counting.BLACK], {(0, 0), (0, 1)})
76-
self.assertEqual(territories[go_counting.WHITE], {(3, 0), (3, 1)})
77-
self.assertEqual(territories[go_counting.NONE], set())
75+
self.assertSetEqual(territories[go_counting.BLACK], {(0, 0), (0, 1)})
76+
self.assertSetEqual(territories[go_counting.WHITE], {(3, 0), (3, 1)})
77+
self.assertSetEqual(territories[go_counting.NONE], set())
7878

7979
def test_two_region_rectangular_board(self):
8080
input_board = [" B "]
8181
board = go_counting.Board(input_board)
8282
territories = board.territories()
83-
self.assertEqual(territories[go_counting.BLACK], {(0, 0), (2, 0)})
84-
self.assertEqual(territories[go_counting.WHITE], set())
85-
self.assertEqual(territories[go_counting.NONE], set())
83+
self.assertSetEqual(territories[go_counting.BLACK], {(0, 0), (2, 0)})
84+
self.assertSetEqual(territories[go_counting.WHITE], set())
85+
self.assertSetEqual(territories[go_counting.NONE], set())
8686

8787
# Utility functions
8888
def setUp(self):

0 commit comments

Comments
 (0)