def test_empty_list(self): expectedIndex = -1 actualIndex = opponent([]) self.assertEquals(expectedIndex, actualIndex)
def test_zero_index(self): expectedIndex = 0 actualIndex = opponent([' ', 'x', 'y']) self.assertEquals(expectedIndex, actualIndex)
def test_last_index(self): expectedIndex = 2 actualIndex = opponent(['x', 'y', ' ']) self.assertEquals(expectedIndex, actualIndex)
def test_first_index(self): expectedIndex = 2 actualIndex = opponent(self.board) self.assertEquals(expectedIndex, actualIndex)
def test_no_index(self): expectedIndex = -1 actualIndex = opponent(['x']) self.assertEquals(expectedIndex, actualIndex)