@@ -29,6 +29,10 @@ final class AttachmentTests: XCTestCase {
29
29
database = nil
30
30
try await super. tearDown ( )
31
31
}
32
+
33
+ func getAttachmentDirectory( ) -> String {
34
+ URL ( fileURLWithPath: NSTemporaryDirectory ( ) ) . appendingPathComponent ( " attachments " ) . path
35
+ }
32
36
33
37
func testAttachmentDownload( ) async throws {
34
38
let queue = AttachmentQueue (
@@ -55,7 +59,7 @@ final class AttachmentTests: XCTestCase {
55
59
56
60
return MockRemoteStorage ( )
57
61
} ( ) ,
58
- attachmentsDirectory: NSTemporaryDirectory ( ) ,
62
+ attachmentsDirectory: getAttachmentDirectory ( ) ,
59
63
watchAttachments: { try self . database. watch ( options: WatchOptions (
60
64
sql: " SELECT photo_id FROM users WHERE photo_id IS NOT NULL " ,
61
65
mapper: { cursor in try WatchedAttachmentItem (
@@ -124,7 +128,7 @@ final class AttachmentTests: XCTestCase {
124
128
let queue = AttachmentQueue (
125
129
db: database,
126
130
remoteStorage: mockedRemote,
127
- attachmentsDirectory: NSTemporaryDirectory ( ) ,
131
+ attachmentsDirectory: getAttachmentDirectory ( ) ,
128
132
watchAttachments: { try self . database. watch ( options: WatchOptions (
129
133
sql: " SELECT photo_id FROM users WHERE photo_id IS NOT NULL " ,
130
134
mapper: { cursor in try WatchedAttachmentItem (
0 commit comments