summaryrefslogtreecommitdiffstats
path: root/framework/domain/mimetreeparser/tests/interfacetest.cpp
diff options
context:
space:
mode:
authorSandro Knauß <sknauss@kde.org>2016-10-11 16:18:50 +0200
committerSandro Knauß <sknauss@kde.org>2016-10-11 16:18:50 +0200
commit1974c19eadd497e355ac985a00d0571f3e6c7712 (patch)
tree051b61cfe222150dc114e5da04fdd072ceffb3b7 /framework/domain/mimetreeparser/tests/interfacetest.cpp
parent6b6f20ffbe06402abcc7d4721ad1f647c3fc4c46 (diff)
downloadkube-1974c19eadd497e355ac985a00d0571f3e6c7712.tar.gz
kube-1974c19eadd497e355ac985a00d0571f3e6c7712.zip
create model for new mailviewer
Diffstat (limited to 'framework/domain/mimetreeparser/tests/interfacetest.cpp')
-rw-r--r--framework/domain/mimetreeparser/tests/interfacetest.cpp27
1 files changed, 26 insertions, 1 deletions
diff --git a/framework/domain/mimetreeparser/tests/interfacetest.cpp b/framework/domain/mimetreeparser/tests/interfacetest.cpp
index ac77b025..5a3cbb87 100644
--- a/framework/domain/mimetreeparser/tests/interfacetest.cpp
+++ b/framework/domain/mimetreeparser/tests/interfacetest.cpp
@@ -198,7 +198,32 @@ private slots:
198 auto contentAttachmentList = parser.collectAttachmentParts(); 198 auto contentAttachmentList = parser.collectAttachmentParts();
199 QCOMPARE(contentAttachmentList.size(), 0); 199 QCOMPARE(contentAttachmentList.size(), 0);
200 } 200 }
201
202 void testOpenPPGInlineWithNonEncText()
203 {
204 Parser parser(readMailFromFile("openpgp-inline-encrypted+nonenc.mbox"));
205 printTree(parser.d->mTree,QString());
206 auto contentPartList = parser.collectContentParts();
207 QCOMPARE(contentPartList.size(), 1);
208 auto contentPart = contentPartList[0];
209 QVERIFY((bool)contentPart);
210 QCOMPARE(contentPart->availableContents(), QVector<QByteArray>() << "plaintext");
211 QCOMPARE(contentPart->encryptions().size(), 0);
212 QCOMPARE(contentPart->signatures().size(), 0);
213 auto contentList = contentPart->content("plaintext");
214 QCOMPARE(contentList.size(), 2);
215 QCOMPARE(contentList[0]->content(), QStringLiteral("Not encrypted not signed :(\n\n").toLocal8Bit());
216 QCOMPARE(contentList[0]->charset(), QStringLiteral("utf-8").toLocal8Bit());
217 QCOMPARE(contentList[0]->encryptions().size(), 0);
218 QCOMPARE(contentList[0]->signatures().size(), 0);
219 QCOMPARE(contentList[1]->content(), QStringLiteral("some random text").toLocal8Bit());
220 QCOMPARE(contentList[1]->charset(), QStringLiteral("utf-8").toLocal8Bit());
221 QCOMPARE(contentList[1]->encryptions().size(), 1);
222 QCOMPARE(contentList[1]->signatures().size(), 0);
223 auto contentAttachmentList = parser.collectAttachmentParts();
224 QCOMPARE(contentAttachmentList.size(), 0);
225 }
201}; 226};
202 227
203QTEST_GUILESS_MAIN(InterfaceTest) 228QTEST_GUILESS_MAIN(InterfaceTest)
204#include "interfacetest.moc" \ No newline at end of file 229#include "interfacetest.moc"