def test_colorImageXml(self): """ Test the XML representation of a color image to match the reference. """ sourcePath = 'files/sunflower' + self.ext expectedPath = 'files/sunflower.xml' message = Message(filePath=sourcePath, messageType='ColorImage') with open(self.targetTextFilePath, 'w') as xmlFile: xmlString = message.getXmlString() xmlFile.write(xmlString) actualTextFile, expectedTextFile = loadTwoTextFiles(self.targetTextFilePath, expectedPath) self.assertEqual(actualTextFile, expectedTextFile)
def test_longTextXml(self): """ Test the XML representation of a long text file to match the reference. """ sourcePath = 'files/full.txt' expectedPath = 'files/full.xml' message = Message(filePath=sourcePath, messageType='Text') with open(self.targetTextFilePath, 'w') as xmlFile: xmlString = message.getXmlString() xmlFile.write(xmlString) actualTextFile, expectedTextFile = loadTwoTextFiles(self.targetTextFilePath, expectedPath) self.assertEqual(actualTextFile, expectedTextFile)
def test_colorImageXml(self): """ Test the XML representation of a color image to match the reference. """ sourcePath = 'files/sunflower' + self.ext expectedPath = 'files/sunflower.xml' message = Message(filePath=sourcePath, messageType='ColorImage') with open(self.targetTextFilePath, 'w') as xmlFile: xmlString = message.getXmlString() xmlFile.write(xmlString) actualTextFile, expectedTextFile = loadTwoTextFiles( self.targetTextFilePath, expectedPath) self.assertEqual(actualTextFile, expectedTextFile)
def test_longTextXml(self): """ Test the XML representation of a long text file to match the reference. """ sourcePath = 'files/full.txt' expectedPath = 'files/full.xml' message = Message(filePath=sourcePath, messageType='Text') with open(self.targetTextFilePath, 'w') as xmlFile: xmlString = message.getXmlString() xmlFile.write(xmlString) actualTextFile, expectedTextFile = loadTwoTextFiles( self.targetTextFilePath, expectedPath) self.assertEqual(actualTextFile, expectedTextFile)