Exemplo n.º 1
0
    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)
Exemplo n.º 2
0
    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)
Exemplo n.º 3
0
    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)
Exemplo n.º 4
0
    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)
Exemplo n.º 5
0
    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)
Exemplo n.º 6
0
    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)
Exemplo n.º 7
0
    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)
Exemplo n.º 8
0
    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)
Exemplo n.º 9
0
    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)
Exemplo n.º 10
0
    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)
Exemplo n.º 11
0
    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)
Exemplo n.º 12
0
    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)