@@ -29,6 +29,10 @@ final class AttachmentTests: XCTestCase {
2929 database = nil
3030 try await super. tearDown ( )
3131 }
32+
33+ func getAttachmentDirectory( ) -> String {
34+ URL ( fileURLWithPath: NSTemporaryDirectory ( ) ) . appendingPathComponent ( " attachments " ) . path
35+ }
3236
3337 func testAttachmentDownload( ) async throws {
3438 let queue = AttachmentQueue (
@@ -55,7 +59,7 @@ final class AttachmentTests: XCTestCase {
5559
5660 return MockRemoteStorage ( )
5761 } ( ) ,
58- attachmentsDirectory: NSTemporaryDirectory ( ) ,
62+ attachmentsDirectory: getAttachmentDirectory ( ) ,
5963 watchAttachments: { try self . database. watch ( options: WatchOptions (
6064 sql: " SELECT photo_id FROM users WHERE photo_id IS NOT NULL " ,
6165 mapper: { cursor in try WatchedAttachmentItem (
@@ -124,7 +128,7 @@ final class AttachmentTests: XCTestCase {
124128 let queue = AttachmentQueue (
125129 db: database,
126130 remoteStorage: mockedRemote,
127- attachmentsDirectory: NSTemporaryDirectory ( ) ,
131+ attachmentsDirectory: getAttachmentDirectory ( ) ,
128132 watchAttachments: { try self . database. watch ( options: WatchOptions (
129133 sql: " SELECT photo_id FROM users WHERE photo_id IS NOT NULL " ,
130134 mapper: { cursor in try WatchedAttachmentItem (
0 commit comments