@@ -383,24 +383,31 @@ final class MockRemoteInterfaceTests: XCTestCase {
383383
384384 func testDownload( ) async throws {
385385 let remoteInterface = MockRemoteInterface ( rootItem: rootItem)
386+ remoteInterface. injectMock ( Self . account)
387+
386388 debugPrint ( remoteInterface)
387- let fileUrl = FileManager . default . temporaryDirectory . appendingPathComponent (
388- " file.txt " , conformingTo: . text
389- )
389+
390+ let fileUrl = FileManager . default . temporaryDirectory . appendingPathComponent ( " file.txt " , conformingTo: . text)
391+
390392 if !FileManager. default. isWritableFile ( atPath: fileUrl. path) {
391393 print ( " WARNING: TEMP NOT WRITEABLE. SKIPPING TEST " )
392394 return
393395 }
396+
394397 let fileData = Data ( " Hello, World! " . utf8)
395398 _ = await remoteInterface. upload (
396- remotePath: Self . account. davFilesUrl + " /file.txt " , localPath: fileUrl. path, account: Self . account
397- )
398-
399- let result = await remoteInterface. download (
400399 remotePath: Self . account. davFilesUrl + " /file.txt " ,
401400 localPath: fileUrl. path,
402401 account: Self . account
403402 )
403+
404+ let result = await remoteInterface. downloadAsync (
405+ serverUrlFileName: Self . account. davFilesUrl + " /file.txt " ,
406+ fileNameLocalPath: fileUrl. path,
407+ account: Self . account. ncKitAccount,
408+ options: . init( )
409+ )
410+
404411 XCTAssertEqual ( result. nkError, . success)
405412
406413 let downloadedData = try Data ( contentsOf: fileUrl)
@@ -859,3 +866,4 @@ final class MockRemoteInterfaceTests: XCTestCase {
859866 XCTAssertEqual ( failState, . authenticationError)
860867 }
861868}
869+
0 commit comments