コード例 #1
0
 def test_grid_coordinates(self):
     grid = boggle.make_grid(2, 2)
     self.assertTrue((0, 0) in grid)
     self.assertTrue((0, 1) in grid)
     self.assertTrue((1, 0) in grid)
     self.assertTrue((1, 1) in grid)
     self.assertTrue((2, 2) not in grid)
コード例 #2
0
 def test_all_grid_neighbours(self):
     grid = boggle.make_grid(2, 2)
     neighbours = boggle.all_grid_neighbours(grid)
     self.assertEquals(len(neighbours), len(grid))
     others = []
     for pos in grid:
         others[:] = grid
         others.remove(pos)
         self.assertListEqual(sorted(neighbours[pos]), sorted(others))
コード例 #3
0
 def test_grid_size_is_width_times_height(self):
     grid = boggle.make_grid(2, 3)
     self.assertEqual(len(grid), 6)
コード例 #4
0
 def test_converting_a_path_to_a_word(self):
     grid = boggle.make_grid(2, 2)
     oneLetterWord = boggle.path_to_word(grid, [(0, 0)])
     twoLetterWord = boggle.path_to_word(grid, [(0, 0), (1, 1)])
     self.assertEqual(oneLetterWord, grid[(0, 0)])
     self.assertEqual(twoLetterWord, grid[(0, 0)] + grid[(1, 1)])
コード例 #5
0
 def test_grid_is_filled_with_letters(self):
     grid = boggle.make_grid(2, 3)
     for L in grid.values():
         self.assertTrue(L in ascii_uppercase)
コード例 #6
0
 def test_can_create_an_empty_grid(self):
         grid = boggle.make_grid(0, 0)
         self.assertEqual(len(grid), 0)
コード例 #7
0
ファイル: test_boggle.py プロジェクト: tom1mol/boggle-repeat
 def test_can_create_an_empty_grid(self): #this case empty grid no assumptions 4 grid shape or data structure used
     #test to see if we can create an empty grid
     grid = boggle.make_grid(0, 0) #height & width or row and column. (0,0) = no rows or columns
     self.assertEqual(len(grid), 0) #0 x 0 grid has a length of 0
コード例 #8
0
ファイル: test_boggle.py プロジェクト: SabeloCodes/boggle
 def test_grid_size_is_row_times_Column(self):
     """
     Test is to show that the total size of the grid is equal to width * height
     """
     grid = boggle.make_grid(2, 3)
     self.assertEqual(len(grid), 6)
コード例 #9
0
    def test_can_create_an_empty_grid(self):

        grid = boggle.make_grid(0, 0)
        #Here we use the method assertequal which is one of many methods inherited from the testcase class.
        self.assertEquals(len(grid), 0)
コード例 #10
0
ファイル: test_boggle.py プロジェクト: S-Downes/CI-Challenges
 def test_grid_returns_correct_size(self):
     """
     Test case to ensure size of grid returned is correct
     """
     grid = boggle.make_grid(2, 3)
     self.assertEqual(len(grid), 6)
コード例 #11
0
 def test_2x3_grid(self):
     grid = boggle.make_grid(2,3)
     self.assertEqual(len(grid),6)
コード例 #12
0
ファイル: test_boggle.py プロジェクト: S-Downes/CI-Challenges
 def test_can_create_empty_grid(self):
     """
     Test case for creating an empty grid
     """
     zero_grid = boggle.make_grid(0, 0)
     self.assertEqual(len(zero_grid), 0)
コード例 #13
0
ファイル: test_boggle.py プロジェクト: davidjryan2000/boggle
 def test_can_create_an_empty_grid(self):
     grid = boggle.make_grid(0, 0)
     self.assertEqual(len(grid), 0,
                      "A grid with no rows or cols has no items")
コード例 #14
0
ファイル: test_boggle.py プロジェクト: tom1mol/boggle-repeat
 def test_grid_size_is_width_times_height(self):
     #test to ensure total size of grid is w x h
     
     grid = boggle.make_grid(2, 3)
     self.assertEqual(len(grid), 6)
コード例 #15
0
 def test_can_create_an_empty_grid(self):
     grid = boggle.make_grid(0, 0)
     self.assertEquals(len(grid), 0)
コード例 #16
0
    def test_grid_size_is_width_times_height(self):
        # test is to ensure that the total size of the grid is equal to width*heught
        grid = boggle.make_grid(2, 3)

        self.assertEquals(len(grid), 6)
コード例 #17
0
 def test_grid_size_is_width_times_height(self):
     grid = boggle.make_grid(2, 3)
     self.assertEquals(len(grid), 6)
コード例 #18
0
 def test_grid_is_filled_with_letters(self):
     #ensure that each of th e coordinates in the grid contains letters
     grid = boggle.make_grid(2, 3)
     for letter in grid.values():
         self.assertIn(letter, ascii_uppercase)
コード例 #19
0
 def test_grid_is_filled_with_letters(self):
     grid = boggle.make_grid(2, 3)
     for L in grid.values():
         self.assertTrue(L in ascii_uppercase)
コード例 #20
0
ファイル: test_boggle.py プロジェクト: pmadden90/python-quiz1
 def test_can_create_an_empty_grid(self):
     """
     TEst to see if we can create an empty grid
     """
     grid = boggle.make_grid(0, 0)
     self.assertEqual(len(grid), 0)
コード例 #21
0
 def test_converting_a_path_to_a_word(self):
     grid = boggle.make_grid(2, 2)
     oneLetterWord = boggle.path_to_word(grid, [(0, 0)])
     twoLetterWord = boggle.path_to_word(grid, [(0, 0), (1, 1)])
     self.assertEquals(oneLetterWord, grid[(0, 0)])
     self.assertEquals(twoLetterWord, grid[(0, 0)] + grid[(1, 1)])
コード例 #22
0
 def test_make_grid(self):
     grid = boggle.make_grid(0, 0)
     self.assertEqual(len(grid), 0)