Skip to content

Commit

Permalink
get test to pass
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewSB committed Feb 28, 2024
1 parent 0c8d01c commit 7dac32b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Tests/NukeThreadSafetyTests/ThreadSafetyTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,15 @@ class ThreadSafetyTests: XCTestCase {

func testDataCacheMultipleThreadAccess() {
let aURL = URL(string: "https://example.com/image-01-small.jpeg")!
let imageData = Data(repeating: 1, count: 256 * 1024)
let imageData = Test.data(name: "fixture", extension: "jpeg")

let expectSuccessFromCache = self.expectation(description: "one successful load, from cache")
expectSuccessFromCache.expectedFulfillmentCount = 1
expectSuccessFromCache.assertForOverFulfill = true

ImagePipeline.shared.cache.storeCachedData(imageData, for: ImageRequest.init(url: aURL))
ImagePipeline.shared.loadImage(with: aURL) { result in
let pipeline = ImagePipeline(configuration: .withDataCache)
pipeline.cache.storeCachedData(imageData, for: ImageRequest.init(url: aURL))
pipeline.loadImage(with: aURL) { result in
switch result {
case .success(let response):
if response.cacheType == .memory || response.cacheType == .disk {
Expand Down

0 comments on commit 7dac32b

Please sign in to comment.