示例#1
0
 def testSingleWaterPond(self):
     self.assertItemsEqual(pondsizes.getPondSizes([(0, 0)]), [1])
示例#2
0
    def testAllAdjacencyTypes(self):
        waterSquares = [(0, 0), (3, 0), (0, 1), (2, 1), (2, 2), (0, 3), (2, 3)]

        self.assertItemsEqual(pondsizes.getPondSizes(waterSquares), [2, 4, 1])
示例#3
0
 def testNoPonds(self):
     self.assertItemsEqual(pondsizes.getPondSizes([]), [])
示例#4
0
 def testDiagonallyAdjacentWaterPond(self):
     self.assertItemsEqual(
         pondsizes.getPondSizes([(0, 0), (1, 1), (0, 2), (2, 2), (2, 0)]),
         [5])
示例#5
0
    def testMultipleDiagonallyAdjacentWaterPonds(self):
        waterSquares = [(0, 0), (1, 1), (2, 0), (4, 1), (3, 2), (1, 3), (2, 4)]

        self.assertItemsEqual(pondsizes.getPondSizes(waterSquares), [3, 2, 2])
示例#6
0
 def testMultipleVerticallyAdjacentWaterPonds(self):
     self.assertItemsEqual(
         pondsizes.getPondSizes([(0, 0), (0, 1), (3, 2), (3, 3), (3, 1)]),
         [3, 2])
示例#7
0
 def testVerticallyAdjacentWaterPond(self):
     self.assertItemsEqual(pondsizes.getPondSizes([(0, 0), (0, 1)]), [2])
示例#8
0
 def testMultipleHorizontallyAdjacentWaterPonds(self):
     self.assertItemsEqual(
         pondsizes.getPondSizes([(0, 0), (1, 0), (1, 2), (2, 2), (3, 2)]),
         [2, 3])
示例#9
0
 def testHorizontallyAdjacentWaterPond(self):
     self.assertItemsEqual(pondsizes.getPondSizes([(0, 0), (1, 0)]), [2])
示例#10
0
 def testMultipleSingleWaterPonds(self):
     self.assertItemsEqual(pondsizes.getPondSizes([(0, 0), (1, 2)]), [1, 1])