def test_embedColorImageVertical(self): """ Test the embedding of a color image in a medium, using a vertical raster scan. """ sourcePath = 'files/sunflower' + self.ext expectedPath = 'files/lake_sunflower_v' + self.ext mediumPath = 'files/lake' + self.ext message = Message(filePath=sourcePath, messageType='ColorImage') medium = ColorSteganography(mediumPath, direction='vertical') medium.embedMessageInMedium(message, self.targetImageFilePath) actualImage, expectedImage = loadTwoImageFiles(self.targetImageFilePath, expectedPath) self.assertEqual(actualImage, expectedImage)
def test_embedGrayImageHorizontal(self): """ Test the embedding of a gray-scale image in a medium, using a horizontal raster scan. """ sourcePath = 'files/lena' + self.ext expectedPath = 'files/tiger_lena_h' + self.ext mediumPath = 'files/tiger' + self.ext message = Message(filePath=sourcePath, messageType='GrayImage') medium = ColorSteganography(mediumPath) medium.embedMessageInMedium(message, self.targetImageFilePath) actualImage, expectedImage = loadTwoImageFiles(self.targetImageFilePath, expectedPath) self.assertEqual(actualImage, expectedImage)
def test_embedTextHorizontal(self): """ Test the embedding of a text file in a medium, using a horizontal raster scan. """ sourcePath = 'files/full.txt' expectedPath = 'files/sunflower_full_h' + self.ext mediumPath = 'files/sunflower' + self.ext message = Message(filePath=sourcePath, messageType='Text') medium = ColorSteganography(mediumPath) medium.embedMessageInMedium(message, self.targetImageFilePath) actualImage, expectedImage = loadTwoImageFiles(self.targetImageFilePath, expectedPath) self.assertEqual(actualImage, expectedImage)
def test_embedColorImageVertical(self): """ Test the embedding of a color image in a medium, using a vertical raster scan. """ sourcePath = 'files/sunflower' + self.ext expectedPath = 'files/lake_sunflower_v' + self.ext mediumPath = 'files/lake' + self.ext message = Message(filePath=sourcePath, messageType='ColorImage') medium = ColorSteganography(mediumPath, direction='vertical') medium.embedMessageInMedium(message, self.targetImageFilePath) actualImage, expectedImage = loadTwoImageFiles( self.targetImageFilePath, expectedPath) self.assertEqual(actualImage, expectedImage)
def test_embedGrayImageHorizontal(self): """ Test the embedding of a gray-scale image in a medium, using a horizontal raster scan. """ sourcePath = 'files/lena' + self.ext expectedPath = 'files/tiger_lena_h' + self.ext mediumPath = 'files/tiger' + self.ext message = Message(filePath=sourcePath, messageType='GrayImage') medium = ColorSteganography(mediumPath) medium.embedMessageInMedium(message, self.targetImageFilePath) actualImage, expectedImage = loadTwoImageFiles( self.targetImageFilePath, expectedPath) self.assertEqual(actualImage, expectedImage)
def test_embedTextHorizontal(self): """ Test the embedding of a text file in a medium, using a horizontal raster scan. """ sourcePath = 'files/full.txt' expectedPath = 'files/sunflower_full_h' + self.ext mediumPath = 'files/sunflower' + self.ext message = Message(filePath=sourcePath, messageType='Text') medium = ColorSteganography(mediumPath) medium.embedMessageInMedium(message, self.targetImageFilePath) actualImage, expectedImage = loadTwoImageFiles( self.targetImageFilePath, expectedPath) self.assertEqual(actualImage, expectedImage)