Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
Itinerary
Commits
9fb3838f
Commit
9fb3838f
authored
Aug 05, 2021
by
Volker Krause
Browse files
Also test importing PDF health certificates
parent
ff12ba6d
Changes
3
Hide whitespace changes
Inline
Side-by-side
autotests/data/health-certificates/negative-pcr-test-fr.pdf
0 → 100644
View file @
9fb3838f
File added
autotests/data/health-certificates/negative-pcr-test-fr.pdf.license
0 → 100644
View file @
9fb3838f
SPDX-FileCopyrightText: https://github.com/eu-digital-green-certificates/dgc-testdata
SPDX-License-Identifier: Apache-2.0
autotests/healthcertificatemanagertest.cpp
View file @
9fb3838f
...
...
@@ -5,6 +5,7 @@
*/
#include
<config-itinerary.h>
#include
<applicationcontroller.h>
#include
<healthcertificatemanager.h>
#include
<QAbstractItemModelTester>
...
...
@@ -30,6 +31,8 @@ private Q_SLOTS:
void
testManager
()
{
ApplicationController
ctrl
;
{
HealthCertificateManager
mgr
;
QAbstractItemModelTester
modelTester
(
&
mgr
);
...
...
@@ -99,12 +102,25 @@ private Q_SLOTS:
{
HealthCertificateManager
mgr
;
QAbstractItemModelTester
modelTester
(
&
mgr
);
QSignalSpy
removeSpy
(
&
mgr
,
&
QAbstractItemModel
::
rowsRemoved
);
QSignalSpy
insertSpy
(
&
mgr
,
&
QAbstractItemModel
::
rowsInserted
);
ctrl
.
setHealthCertificateManager
(
&
mgr
);
#if HAVE_KHEALTHCERTIFICATE
QCOMPARE
(
mgr
.
rowCount
(),
2
);
ctrl
.
importFromUrl
(
QUrl
::
fromLocalFile
(
QLatin1String
(
SOURCE_DIR
"/data/health-certificates/negative-pcr-test-fr.pdf"
)));
QCOMPARE
(
mgr
.
rowCount
(),
3
);
QCOMPARE
(
insertSpy
.
size
(),
1
);
#endif
}
{
HealthCertificateManager
mgr
;
QAbstractItemModelTester
modelTester
(
&
mgr
);
QSignalSpy
removeSpy
(
&
mgr
,
&
QAbstractItemModel
::
rowsRemoved
);
#if HAVE_KHEALTHCERTIFICATE
QCOMPARE
(
mgr
.
rowCount
(),
3
);
mgr
.
removeCertificate
(
0
);
QCOMPARE
(
removeSpy
.
size
(),
1
);
QCOMPARE
(
mgr
.
rowCount
(),
1
);
QCOMPARE
(
mgr
.
rowCount
(),
2
);
#endif
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment