def test_assemblePuzzle_fTest_knownGoodAssembly(self): d = tiles.Dealer(self.fTest) d.assemblePuzzle() matched = False for t in d.puzzle.spin(): matched |= t.tile == self.knownPuzzleSolution self.assertTrue(matched)
def test_assemblePuzzle_fInput_dims(self): d = tiles.Dealer(self.fInput) tileDims = d.tiles[0].dims puzzleDims = d.dims finalDims = ((tileDims[0] - 2) * puzzleDims[0], (tileDims[1] - 2) * puzzleDims[1]) d.assemblePuzzle() self.assertEqual(finalDims, d.puzzle.dims)
def test_findSerpents_fInput_count(self): d = tiles.Dealer(self.fInput) d.assemblePuzzle() self.assertEqual(21, len(d.findSerpents()))
def test_assemblePuzzle_fInput_count(self): d = tiles.Dealer(self.fInput) d.assemblePuzzle() self.assertEqual(1922, d.puzzle.countSymbol('#'))
def test_assemblePuzzle_fTest_count(self): d = tiles.Dealer(self.fTest) d.assemblePuzzle() self.assertEqual(303, d.puzzle.countSymbol('#'))
def test_init_corners_fTest(self): d = tiles.Dealer(self.fTest) self.assertEqual(20899048083289, d.calculateCornerMultiple())
def test_init_corners_fInput(self): d = tiles.Dealer(self.fInput) self.assertEqual(45443966642567, d.calculateCornerMultiple())
def test_init_fTest_dims(self): d = tiles.Dealer(self.fTest) self.assertEqual(9, d.count) self.assertEqual((3, 3), d.dims)