File: kgpgaddphoto.cpp

package info (click to toggle)
kgpg 4%3A18.08.3-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 12,168 kB
  • sloc: cpp: 18,911; xml: 159; makefile: 8; sh: 4
file content (29 lines) | stat: -rw-r--r-- 940 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "kgpgaddphoto.h"
#include "../transactions/kgpgaddphoto.h"
#include "../kgpginterface.h"
#include "common.h"

#include <QSignalSpy>
#include <QtTest>

void KGpgAddPhotoTest::init()
{
	QVERIFY(resetGpgConf(m_tempdir));
}

void KGpgAddPhotoTest::testAddPhoto()
{
	const QString passphrase = readFile(QLatin1String("keys/kgpgtest_BA7695F3C550DF14.pass"));
	addGpgKey(m_tempdir, QLatin1String("keys/kgpgtest_BA7695F3C550DF14_pub.asc"));
	addGpgKey(m_tempdir, QLatin1String("keys/kgpgtest_BA7695F3C550DF14.asc"), passphrase);
	QString keyID = QLatin1String("BA7695F3C550DF14");
	QString imagepath = QLatin1String("keys/image_small.jpg");
	KGpgAddPhoto *transaction = new KGpgAddPhoto(this, keyID, imagepath);
	addPasswordArguments(transaction, passphrase);
	QSignalSpy spy(transaction, &KGpgAddPhoto::done);
	transaction->start();
	QVERIFY(spy.wait(10000));
	QVERIFY(hasPhoto(m_tempdir, keyID));
}

QTEST_GUILESS_MAIN(KGpgAddPhotoTest)