Esempio n. 1
0
 def test_neighbours_of_a_position(self):
     # ensures that a position has 8 neighbours
     coords = (1, 2)
     neighbours = boggle.neighbours_of_position(coords)
     self.assertIn((0, 1), neighbours)
     self.assertIn((0, 2), neighbours)
     self.assertIn((0, 3), neighbours)
     self.assertIn((1, 1), neighbours)
     self.assertIn((2, 2), neighbours)
def test_neighbours_of_a_position(self):
    neighbours = boggle.neighbours_of_position((1, 2))
    self.assertTrue((0, 1) in neighbours)
    self.assertTrue((0, 2) in neighbours)
    self.assertTrue((0, 3) in neighbours)
    self.assertTrue((1, 1) in neighbours)
    self.assertTrue((1, 3) in neighbours)
    self.assertTrue((2, 1) in neighbours)
    self.assertTrue((2, 2) in neighbours)
    self.assertTrue((2, 3) in neighbours)
 def test_neighbours_of_a_position(self):
     neighbours = boggle.neighbours_of_position((1, 2))
     self.assertTrue((0, 1) in neighbours)
     self.assertTrue((0, 2) in neighbours)
     self.assertTrue((0, 3) in neighbours)
     self.assertTrue((1, 1) in neighbours)
     self.assertTrue((1, 3) in neighbours)
     self.assertTrue((2, 1) in neighbours)
     self.assertTrue((2, 2) in neighbours)
     self.assertTrue((2, 3) in neighbours)
 def test_neighbours_of_a_position(self):
     coords = (1, 2)
     neighbours = boggle.neighbours_of_position(coords)
     self.assertIn((0, 1), neighbours)
     self.assertIn((0, 2), neighbours)
     self.assertIn((0, 3), neighbours)
     self.assertIn((1, 1), neighbours)
     self.assertIn((1, 3), neighbours)
     self.assertIn((2, 1), neighbours)
     self.assertIn((2, 2), neighbours)
     self.assertIn((2, 3), neighbours)
Esempio n. 5
0
 def test_neighbours_of_a_position(self):
     """
     Ensure the letter has 8 neighbours
     """
     coords = (1, 2)
     neighbours = boggle.neighbours_of_position(coords)
     self.assertIn((0, 1), neighbours)
     self.assertIn((0, 2), neighbours)
     self.assertIn((0, 3), neighbours)
     self.assertIn((1, 1), neighbours)
     self.assertIn((1, 3), neighbours)
     self.assertIn((2, 1), neighbours)
     self.assertIn((2, 2), neighbours)
     self.assertIn((2, 3), neighbours)
Esempio n. 6
0
 def test_neighbours_of_a_position(self):
     """
     ENSURE THAT A POSITION HAS 8 NEIGHBOURS
     """
     coords = (1, 2)
     neighbours = boggle.neighbours_of_position(coords)
     self.assertIn((0, 1), neighbours)
     self.assertIn((0, 2), neighbours)
     self.assertIn((0, 3), neighbours)
     self.assertIn((1, 1), neighbours)
     self.assertIn((1, 3), neighbours)
     self.assertIn((2, 1), neighbours)
     self.assertIn((2, 2), neighbours)
     self.assertIn((2, 3), neighbours)
Esempio n. 7
0
 def test_neighbours_of_a_position(self):
     """
     Ensure That A Position Has 8 Neighbours
     """
     coords = (1, 2)
     neighbours = boggle.neighbours_of_position(coords)
     self.assertIn((0, 1), neighbours)
     self.assertIn((0, 2), neighbours)
     self.assertIn((0, 3), neighbours)
     self.assertIn((1, 1), neighbours)
     self.assertIn((1, 3), neighbours)
     self.assertIn((2, 1), neighbours)
     self.assertIn((2, 2), neighbours)
     self.assertIn((2, 3), neighbours)
Esempio n. 8
0
 def test_neighbors_of_a_position(self):
     """
     Ensure that a position has 8 neighbors. This test doesnt allow for corners or edges
     """
     coords = (1, 2)
     neighbours = boggle.neighbours_of_position(coords)
     self.assertIn((0, 1), neighbours)
     self.assertIn((0, 2), neighbours)
     self.assertIn((0, 3), neighbours)
     self.assertIn((1, 1), neighbours)
     self.assertIn((1, 3), neighbours)
     self.assertIn((2, 1), neighbours)
     self.assertIn((2, 2), neighbours)
     self.assertIn((2, 3), neighbours)
Esempio n. 9
0
 def test_neighbours_of_a_position(self):
     """
     Ensure that a position has 8 neighbours
     """
     coords = (2, 2)
     neighbours = boggle.neighbours_of_position(coords)
     self.assertIn((1, 1), neighbours)
     self.assertIn((1, 2), neighbours)
     self.assertIn((1, 3), neighbours)
     self.assertIn((2, 1), neighbours)
     self.assertIn((2, 3), neighbours)
     self.assertIn((3, 1), neighbours)
     self.assertIn((3, 2), neighbours)
     self.assertIn((3, 3), neighbours)
Esempio n. 10
0
 def test_neighbors_of_a_position(self):
     """
     In a 3:3 grid, ensures that position has 8 neighbours
     """
     coords = (1, 2)
     neighbours = boggle.neighbours_of_position(coords)
     self.assertIn((0, 1), neighbours)
     self.assertIn((0, 2), neighbours)
     self.assertIn((0, 3), neighbours)
     self.assertIn((1, 1), neighbours)
     self.assertIn((1, 3), neighbours)
     self.assertIn((2, 1), neighbours)
     self.assertIn((2, 2), neighbours)
     self.assertIn((2, 3), neighbours)
Esempio n. 11
0
 def test_neighbours_of_a_position(self):
     
     #ensure that a position has 8 neighbours. function takes a position and returns 8 neighbours it should have
     
     coords = (1, 2)
     neighbours = boggle.neighbours_of_position(coords)
     self.assertIn((0, 1), neighbours)
     self.assertIn((0, 2), neighbours)
     self.assertIn((0, 3), neighbours)
     self.assertIn((1, 1), neighbours)
     self.assertIn((1, 3), neighbours)
     self.assertIn((2, 1), neighbours)
     self.assertIn((2, 2), neighbours)
     self.assertIn((2, 3), neighbours)
Esempio n. 12
0
 def test_neighbours_of_a_position(self):
     """
     Ensure that a position has 8 neighbours
     """
     coords = (1, 2)
     # Unless on the edge, a postion will have 8 neighbours
     neighbours = boggle.neighbours_of_position(coords)
     self.assertIn((0, 1), neighbours)
     self.assertIn((0, 2), neighbours)
     self.assertIn((0, 3), neighbours)
     self.assertIn((1, 1), neighbours)
     self.assertIn((1, 3), neighbours)
     self.assertIn((2, 1), neighbours)
     self.assertIn((2, 2), neighbours)
     self.assertIn((2, 3), neighbours)
Esempio n. 13
0
 def test_neighbours_of_a_position(self):
     '''
     Ensure that a position has 8 neighbours
     '''
     coords = (1, 2)
     # We call functions that we will define after writing the test
     neighbours = boggle.neighbours_of_position(coords)
     #This takes the position of a grid and returns the 8 neighbours that it should have
     self.assertIn((0, 1), neighbours)
     self.assertIn((0, 2), neighbours)
     self.assertIn((0, 3), neighbours)
     self.assertIn((1, 1), neighbours)
     self.assertIn((1, 3), neighbours)
     self.assertIn((2, 1), neighbours)
     self.assertIn((2, 2), neighbours)
     self.assertIn((2, 3), neighbours)