From 5691f958336849456603fa38f9ff86c9f0bb0e81 Mon Sep 17 00:00:00 2001 From: Anubhav Choudhary Date: Fri, 2 Apr 2021 23:50:41 -0600 Subject: [PATCH] [logUpload] Added one more test --- src/libcalamaresui/utils/TestPaste.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/libcalamaresui/utils/TestPaste.cpp b/src/libcalamaresui/utils/TestPaste.cpp index 6fea608fe..2245c76c4 100644 --- a/src/libcalamaresui/utils/TestPaste.cpp +++ b/src/libcalamaresui/utils/TestPaste.cpp @@ -10,6 +10,7 @@ */ #include "Paste.h" +#include "network/Manager.h" #include "utils/Logger.h" @@ -30,6 +31,7 @@ public: private Q_SLOTS: void testGetLogFile(); void testFichePaste(); + void testUploadSize(); }; void @@ -64,7 +66,19 @@ TestPaste::testFichePaste() QVERIFY( !s.isEmpty() ); } +void +TestPaste::testUploadSize() +{ + QByteArray logContent = logFileContents( 100 ); + QString s = ficheLogUpload( logContent, QUrl( "http://termbin.com:9999" ), nullptr ); + QVERIFY( !s.isEmpty() ); + + QUrl url( s ); + QByteArray returnedData = CalamaresUtils::Network::Manager::instance().synchronousGet( url ); + + QCOMPARE( returnedData.size(), 100 ); +} QTEST_GUILESS_MAIN( TestPaste ) #include "utils/moc-warnings.h"