mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-12-06 04:07:54 +00:00
Move location of test folders.
This commit is contained in:
1 parent
3039b3b6c9
commit
e88ce51214
1 file changed
+6
-11
@@ -16,9 +16,9 @@ import Secrets
|
||||
|
||||
nonisolated static let shared = TestAccountManager()
|
||||
|
||||
var accountsFolder: URL {
|
||||
return try! FileManager.default.url(for: .cachesDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
|
||||
}
|
||||
// Not Caches: macOS puts a `group:everyone deny delete` ACE on it, so test accounts
|
||||
// created there can't be removed afterward.
|
||||
private let accountsFolder = FileManager.default.temporaryDirectory.appendingPathComponent("NetNewsWireTestAccounts")
|
||||
|
||||
func createAccount(type: AccountType, username: String? = nil, password: String? = nil) -> Account {
|
||||
|
||||
@@ -46,13 +46,8 @@ import Secrets
|
||||
|
||||
account.deleteSettings()
|
||||
|
||||
do {
|
||||
try FileManager.default.removeItem(atPath: account.dataFolder)
|
||||
} catch let error as CocoaError where error.code == .fileNoSuchFile {
|
||||
|
||||
} catch {
|
||||
assertionFailure("Could not delete folder at: \(account.dataFolder) because \(error)")
|
||||
abort()
|
||||
}
|
||||
// Cleanup failing is not a test failure, and aborting here would take every
|
||||
// other test in the process down with it.
|
||||
try? FileManager.default.removeItem(atPath: account.dataFolder)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user