def test_check_for_rings1(self): """ Tests the default rings are properly identified. """ b = Board() expected_rings = {(2, 11): 'b', (17, 11): 'w'} self.assertDictEqual(expected_rings, b.check_for_rings())
def test_check_for_rings4(self): """ Test that mixed color rings are not identified. """ b = Board() target = { (3, 3): "", (3, 4): "w", (3, 5): "w", (2, 3): "w", (2, 4): "w", (2, 5): "w", (1, 3): "", (1, 4): "w", (1, 5): "w" } b.place_piece(target) expected_rings = {(2, 11): 'b', (17, 11): 'w'} self.assertDictEqual(expected_rings, b.check_for_rings())
def test_check_for_rings3(self): """ Test that black rings will be added. """ b = Board() target = { (3, 3): "", (3, 4): "b", (3, 5): "b", (2, 3): "b", (2, 4): "b", (2, 5): "b", (1, 3): "", (1, 4): "b", (1, 5): "b" } b.place_piece(target) expected_rings = {(2, 6): 'b', (2, 11): 'b', (17, 11): 'w'} self.assertDictEqual(expected_rings, b.check_for_rings())
def test_check_for_rings2(self): """ Tests that white rings will be added. """ b = Board() target = { (18, 3): "", (18, 4): "w", (18, 5): "w", (17, 3): "w", (17, 4): "w", (17, 5): "w", (16, 3): "", (16, 4): "w", (16, 5): "w" } b.place_piece(target) expected_rings = {(17, 6): 'w', (2, 11): 'b', (17, 11): 'w'} self.assertDictEqual(expected_rings, b.check_for_rings())