         
         let data = Data("hello".utf8)
         
-        MockURLProtocol.prepareResponse(for: "POST") {
-            MockURLProtocol.Response(status: 200, headers: ["Location": "www.somefakelocation.com"], data: nil)
-        }
-        
-        MockURLProtocol.prepareResponse(for: "PATCH") {
-            MockURLProtocol.Response(status: 200, headers: ["Upload-Offset": String(data.count)], data: nil)
-        }
-        
+        prepareNetworkForSuccesfulUploads(data: data)
         // Make sure id's that are given when uploading, are returned when uploads are finished
         let expectedId = try client.upload(data: data)
         

        try XCTAssertThrowsError(client.upload(data: data))
    }
    
    func testUploadsCanBeChunked() throws {
        // TODO: Be sure to trigger multiple uploads (e.g. small chunk to upload, first offset is half of data, then complete)
        // TODO: Support MockURLProtocol to update the offset during uploads
        XCTFail("Implement me")
    }
    
    // MARK: - File handling
    
    func testClientCanHandleDirectoryStartingWithOrWithoutForwardSlash() {


        otherClientContents = try FileManager.default.contentsOfDirectory(at: otherLocation, includingPropertiesForKeys: nil)
        XCTAssert(!otherClientContents.isEmpty)
    }
    
    // MARK: - Large files
    
    func testUploadsCanBeChunked() throws {
        // TODO: Be sure to trigger multiple uploads (e.g. small chunk to upload, first offset is half of data, then complete)
        // TODO: Support MockURLProtocol to update the offset during uploads
        XCTFail("Implement me")
    }
    
}
