Do not check the data for requests that don't expect any

The public postman-echo service returns different data
This commit is contained in:
Mm2PL 2024-10-15 02:03:40 +02:00
parent 4d02987365
commit 6c1273dbbd
No known key found for this signature in database
GPG key ID: 94AC9B80EFA15ED9

View file

@ -399,7 +399,7 @@ TEST_F(PluginTest, testHttp)
QString error; QString error;
NetworkRequestType meth = NetworkRequestType::Get; NetworkRequestType meth = NetworkRequestType::Get;
QByteArray data; QByteArray data; // null means do not check
}; };
std::vector<RequestCase> cases{ std::vector<RequestCase> cases{
@ -447,8 +447,11 @@ TEST_F(PluginTest, testHttp)
EXPECT_EQ((*lua)["status"], sol::nil); EXPECT_EQ((*lua)["status"], sol::nil);
} }
EXPECT_EQ(lua->get<QString>("error"), c.error); EXPECT_EQ(lua->get<QString>("error"), c.error);
if (!c.data.isNull())
{
EXPECT_EQ(lua->get<QByteArray>("data"), c.data); EXPECT_EQ(lua->get<QByteArray>("data"), c.data);
} }
}
} }
const QByteArray TEST_FILE_DATA = "Test file data\nWith a new line.\n"; const QByteArray TEST_FILE_DATA = "Test file data\nWith a new line.\n";