fix tests

This commit is contained in:
Michael Zanetti 2017-07-07 18:01:26 +02:00
parent ce123f9352
commit 165f61ee20

View File

@ -506,10 +506,8 @@ void TestJSONRPC::stateChangeEmitsNotifications()
QNetworkRequest request(QUrl(QString("http://localhost:%1/setstate?%2=%3").arg(m_mockDevice1Port).arg(stateTypeId.toString()).arg(QString::number(newVal))));
QNetworkReply *reply = nam.get(request);
connect(reply, SIGNAL(finished()), reply, SLOT(deleteLater()));
qDebug() << "Waiting for notifications";
QVERIFY(clientSpy.wait());
QSignalSpy replySpy(reply, SIGNAL(finished()));
replySpy.wait();
// Make sure the notification contains all the stuff we expect
QVariantList stateChangedVariants = checkNotifications(clientSpy, "Devices.StateChanged");
@ -608,9 +606,6 @@ void TestJSONRPC::pluginConfigChangeEmitsNotification()
response = injectAndWait("Devices.SetPluginConfiguration", params);
qDebug() << "Waiting for notifications";
QVERIFY(clientSpy.wait());
QVariantList notificationData = checkNotifications(clientSpy, "Devices.PluginConfigurationChanged");
QCOMPARE(notificationData.first().toMap().value("notification").toString() == "Devices.PluginConfigurationChanged", true);
}