def test_extractColorImageVertical(self): """ Test the extraction of a color in a medium, using a vertical raster scan. """ sourcePath = 'files/lake_sunflower_v' + self.ext expectedPath = 'files/sunflower' + self.ext medium = ColorSteganography(sourcePath, direction='vertical') message = medium.extractMessageFromMedium() message.saveToTarget(self.targetImageFilePath) actualImage, expectedImage = loadTwoImageFiles(self.targetImageFilePath, expectedPath) self.assertEqual(actualImage, expectedImage)
def test_extractGrayImageHorizontal(self): """ Test the extraction of a gray-scale in a medium, using a horizontal raster scan. """ sourcePath = 'files/tiger_lena_h' + self.ext expectedPath = 'files/lena' + self.ext medium = ColorSteganography(sourcePath) message = medium.extractMessageFromMedium() message.saveToTarget(self.targetImageFilePath) actualImage, expectedImage = loadTwoImageFiles(self.targetImageFilePath, expectedPath) self.assertEqual(actualImage, expectedImage)
def test_extractTextVertical(self): """ Test the extraction of a text file in a medium, using a vertical raster scan. """ sourcePath = 'files/sunflower_full_v' + self.ext expectedPath = 'files/full.txt' medium = ColorSteganography(sourcePath, direction='vertical') message = medium.extractMessageFromMedium() message.saveToTarget(self.targetTextFilePath) actualTextFile, expectedTextFile = loadTwoTextFiles(self.targetTextFilePath, expectedPath) self.assertEqual(actualTextFile, expectedTextFile)
def test_extractColorImageVertical(self): """ Test the extraction of a color in a medium, using a vertical raster scan. """ sourcePath = 'files/lake_sunflower_v' + self.ext expectedPath = 'files/sunflower' + self.ext medium = ColorSteganography(sourcePath, direction='vertical') message = medium.extractMessageFromMedium() message.saveToTarget(self.targetImageFilePath) actualImage, expectedImage = loadTwoImageFiles( self.targetImageFilePath, expectedPath) self.assertEqual(actualImage, expectedImage)
def test_extractGrayImageHorizontal(self): """ Test the extraction of a gray-scale in a medium, using a horizontal raster scan. """ sourcePath = 'files/tiger_lena_h' + self.ext expectedPath = 'files/lena' + self.ext medium = ColorSteganography(sourcePath) message = medium.extractMessageFromMedium() message.saveToTarget(self.targetImageFilePath) actualImage, expectedImage = loadTwoImageFiles( self.targetImageFilePath, expectedPath) self.assertEqual(actualImage, expectedImage)
def test_extractTextVertical(self): """ Test the extraction of a text file in a medium, using a vertical raster scan. """ sourcePath = 'files/sunflower_full_v' + self.ext expectedPath = 'files/full.txt' medium = ColorSteganography(sourcePath, direction='vertical') message = medium.extractMessageFromMedium() message.saveToTarget(self.targetTextFilePath) actualTextFile, expectedTextFile = loadTwoTextFiles( self.targetTextFilePath, expectedPath) self.assertEqual(actualTextFile, expectedTextFile)
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)