Skip to content

Commit

Permalink
fixing code layout
Browse files Browse the repository at this point in the history
  • Loading branch information
VitorVieiraZ committed Nov 5, 2024
1 parent b574a27 commit 9ed8bb4
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions app/test/testmerginapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2945,34 +2945,34 @@ void TestMerginApi::testParseVersion()

void TestMerginApi::testDownloadWithNetworkError()
{
QString projectName = "testDownloadWithNetworkError";
QString projectNamespace = mWorkspaceName;
QString projectName = "testDownloadWithNetworkError";
QString projectNamespace = mWorkspaceName;

// Create a test project on server
createRemoteProject( mApiExtra, projectNamespace, projectName, mTestDataPath + "/" + TEST_PROJECT_NAME + "/" );
// Create a test project on server
createRemoteProject( mApiExtra, projectNamespace, projectName, mTestDataPath + "/" + TEST_PROJECT_NAME + "/" );

// Create mock network manager
MockNetworkManager *mockManager = new MockNetworkManager( mApi );
mApi->setNetworkManager( mockManager );
// Create mock network manager
MockNetworkManager *mockManager = new MockNetworkManager( mApi );
mApi->setNetworkManager( mockManager );

// Track retry signals
QSignalSpy retrySpy( mApi, &MerginApi::downloadItemRetried );
// Track retry signals
QSignalSpy retrySpy( mApi, &MerginApi::downloadItemRetried );

// Start download and make network fail after project info
mApi->pullProject( projectNamespace, projectName );
// Start download and make network fail after project info
mApi->pullProject( projectNamespace, projectName );

QSignalSpy pullStartedSpy( mApi, &MerginApi::pullFilesStarted );
QVERIFY( pullStartedSpy.wait( TestUtils::SHORT_REPLY ) );
mockManager->setShouldFail( true );
QSignalSpy pullStartedSpy( mApi, &MerginApi::pullFilesStarted );
QVERIFY( pullStartedSpy.wait( TestUtils::SHORT_REPLY ) );
mockManager->setShouldFail( true );

// Wait for sync to finish
QSignalSpy syncFinishedSpy( mApi, &MerginApi::syncProjectFinished );
QVERIFY( syncFinishedSpy.wait( TestUtils::LONG_REPLY ) );
// Wait for sync to finish
QSignalSpy syncFinishedSpy( mApi, &MerginApi::syncProjectFinished );
QVERIFY( syncFinishedSpy.wait( TestUtils::LONG_REPLY ) );

// Verify we got retry signals
QVERIFY( retrySpy.count() > 0 );
// Verify we got retry signals
QVERIFY( retrySpy.count() > 0 );

// Cleanup
mApi->setNetworkManager( new QNetworkAccessManager( mApi ) );
deleteRemoteProjectNow( mApi, projectNamespace, projectName );
// Cleanup
mApi->setNetworkManager( new QNetworkAccessManager( mApi ) );
deleteRemoteProjectNow( mApi, projectNamespace, projectName );
}

1 comment on commit 9ed8bb4

@inputapp-bot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iOS - version 24.11.692811 just submitted!

Please sign in to comment.