mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-12-01 01:40:22 +00:00
Merge branch 'master' of https://github.com/brentsimmons/NetNewsWire
This commit is contained in:
commit
d16cc88577
5 files changed
+35
-21
No files matched your search
@@ -121,6 +121,7 @@
|
||||
9EE4CCFA234F106600FBAE4B /* FeedlyFeedContainerValidator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EE4CCF9234F106600FBAE4B /* FeedlyFeedContainerValidator.swift */; };
|
||||
9EEEF71F23545CB4009E9D80 /* FeedlySendArticleStatusesOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EEEF71E23545CB4009E9D80 /* FeedlySendArticleStatusesOperation.swift */; };
|
||||
9EEEF7212355277F009E9D80 /* FeedlySyncStarredArticlesOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EEEF7202355277F009E9D80 /* FeedlySyncStarredArticlesOperation.swift */; };
|
||||
9EEEF75223567CA6009E9D80 /* saved_initial.json in Resources */ = {isa = PBXBuildFile; fileRef = 9EEEF75123567CA6009E9D80 /* saved_initial.json */; };
|
||||
9EF35F7A234E830E003AE2AE /* FeedlyCompoundOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EF35F79234E830E003AE2AE /* FeedlyCompoundOperation.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
@@ -301,6 +302,7 @@
|
||||
9EE4CCF9234F106600FBAE4B /* FeedlyFeedContainerValidator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedlyFeedContainerValidator.swift; sourceTree = "<group>"; };
|
||||
9EEEF71E23545CB4009E9D80 /* FeedlySendArticleStatusesOperation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedlySendArticleStatusesOperation.swift; sourceTree = "<group>"; };
|
||||
9EEEF7202355277F009E9D80 /* FeedlySyncStarredArticlesOperation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedlySyncStarredArticlesOperation.swift; sourceTree = "<group>"; };
|
||||
9EEEF75123567CA6009E9D80 /* saved_initial.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = saved_initial.json; sourceTree = "<group>"; };
|
||||
9EF35F79234E830E003AE2AE /* FeedlyCompoundOperation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedlyCompoundOperation.swift; sourceTree = "<group>"; };
|
||||
D511EEB5202422BB00712EC3 /* Account_project_debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Account_project_debug.xcconfig; sourceTree = "<group>"; };
|
||||
D511EEB6202422BB00712EC3 /* Account_target.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Account_target.xcconfig; sourceTree = "<group>"; };
|
||||
@@ -523,6 +525,7 @@
|
||||
9E7F150B2341F2A700F860D1 /* Initial */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
9EEEF75123567CA6009E9D80 /* saved_initial.json */,
|
||||
9E7F15092341EF5A00F860D1 /* feedly_collections_initial.json */,
|
||||
9E7F150C2341F32000F860D1 /* macintosh_initial.json */,
|
||||
9E7F15162341F48900F860D1 /* mustread_initial.json */,
|
||||
@@ -780,6 +783,7 @@
|
||||
51D5875C227F630B00900287 /* tags_initial.json in Resources */,
|
||||
51D5875A227F630B00900287 /* tags_delete.json in Resources */,
|
||||
5165D71722821C2400D9D53D /* taggings_add.json in Resources */,
|
||||
9EEEF75223567CA6009E9D80 /* saved_initial.json in Resources */,
|
||||
9E832B23234416B400D83249 /* feedly_collections_addfeed.json in Resources */,
|
||||
5165D71622821C2400D9D53D /* taggings_delete.json in Resources */,
|
||||
9E7F15112341F39A00F860D1 /* uncategorized_initial.json in Resources */,
|
||||
|
||||
@@ -20,9 +20,9 @@ class AccountFeedSyncTest: XCTestCase {
|
||||
func testDownloadSync() {
|
||||
|
||||
let testTransport = TestTransport()
|
||||
testTransport.testFiles["https://api.feedbin.com/v2/tags.json"] = "tags_add.json"
|
||||
testTransport.testFiles["https://api.feedbin.com/v2/subscriptions.json"] = "subscriptions_initial.json"
|
||||
testTransport.testFiles["https://api.feedbin.com/v2/icons.json"] = "icons.json"
|
||||
testTransport.testFiles["tags.json"] = "tags_add.json"
|
||||
testTransport.testFiles["subscriptions.json"] = "subscriptions_initial.json"
|
||||
testTransport.testFiles["icons.json"] = "icons.json"
|
||||
let account = TestAccountManager.shared.createAccount(type: .feedbin, transport: testTransport)
|
||||
|
||||
// Test initial folders
|
||||
@@ -52,9 +52,9 @@ class AccountFeedSyncTest: XCTestCase {
|
||||
XCTAssertEqual(225, account.flattenedFeeds().count)
|
||||
|
||||
let bPixels = account.idToFeedDictionary["1096623"]
|
||||
XCTAssertEqual("Beautiful Pixels", bPixels!.name)
|
||||
XCTAssertEqual("https://feedpress.me/beautifulpixels", bPixels!.url)
|
||||
XCTAssertEqual("https://beautifulpixels.com/", bPixels!.homePageURL)
|
||||
XCTAssertEqual("Beautiful Pixels", bPixels?.name)
|
||||
XCTAssertEqual("https://feedpress.me/beautifulpixels", bPixels?.url)
|
||||
XCTAssertEqual("https://beautifulpixels.com/", bPixels?.homePageURL)
|
||||
XCTAssertEqual("https://favicons.feedbinusercontent.com/ea0/ea010c658d6e356e49ab239b793dc415af707b05.png", bPixels?.faviconURL)
|
||||
|
||||
TestAccountManager.shared.deleteAccount(account)
|
||||
|
||||
@@ -148,6 +148,8 @@ class AccountFeedlySyncTest: XCTestCase {
|
||||
account.refreshAll() { _ in
|
||||
preparationExpectation.fulfill()
|
||||
}
|
||||
// If there's a failure here, then an operation hasn't completed.
|
||||
// Check that test files have responses for all the requests this might make.
|
||||
waitForExpectations(timeout: 5)
|
||||
}
|
||||
|
||||
@@ -282,18 +284,17 @@ class AccountFeedlySyncTest: XCTestCase {
|
||||
|
||||
func set(testFiles: TestFiles, with transport: TestTransport) {
|
||||
// TestTransport blacklists certain query items to make mocking responses easier.
|
||||
let endpoint = "https://sandbox7.feedly.com/v3"
|
||||
let category = "\(endpoint)/streams/contents?streamId=user/f2f031bd-f3e3-4893-a447-467a291c6d1e/category"
|
||||
|
||||
let collectionsEndpoint = "/v3/collections"
|
||||
switch testFiles {
|
||||
case .initial:
|
||||
let dict = [
|
||||
"\(endpoint)/collections": "feedly_collections_initial.json",
|
||||
"\(category)/5ca4d61d-e55d-4999-a8d1-c3b9d8789815": "macintosh_initial.json",
|
||||
"\(category)/global.must": "mustread_initial.json",
|
||||
"\(category)/885f2e01-d314-4e63-abac-17dcb063f5b5": "programming_initial.json",
|
||||
"\(category)/66132046-6f14-488d-b590-8e93422723c8": "uncategorized_initial.json",
|
||||
"\(category)/e31b3fcb-27f6-4f3e-b96c-53902586e366": "weblogs_initial.json",
|
||||
"/global.saved": "saved_initial.json",
|
||||
collectionsEndpoint: "feedly_collections_initial.json",
|
||||
"/5ca4d61d-e55d-4999-a8d1-c3b9d8789815": "macintosh_initial.json",
|
||||
"/global.must": "mustread_initial.json",
|
||||
"/885f2e01-d314-4e63-abac-17dcb063f5b5": "programming_initial.json",
|
||||
"/66132046-6f14-488d-b590-8e93422723c8": "uncategorized_initial.json",
|
||||
"/e31b3fcb-27f6-4f3e-b96c-53902586e366": "weblogs_initial.json",
|
||||
]
|
||||
transport.testFiles = dict
|
||||
|
||||
@@ -301,16 +302,16 @@ class AccountFeedlySyncTest: XCTestCase {
|
||||
set(testFiles: .initial, with: transport)
|
||||
|
||||
var dict = transport.testFiles
|
||||
dict["\(endpoint)/collections"] = "feedly_collections_addcollection.json"
|
||||
dict["\(category)/fc09f383-5a9a-4daa-a575-3efc1733b173"] = "newcollection_addcollection.json"
|
||||
dict[collectionsEndpoint] = "feedly_collections_addcollection.json"
|
||||
dict["/fc09f383-5a9a-4daa-a575-3efc1733b173"] = "newcollection_addcollection.json"
|
||||
transport.testFiles = dict
|
||||
|
||||
case .addFeed:
|
||||
set(testFiles: .addCollection, with: transport)
|
||||
|
||||
var dict = transport.testFiles
|
||||
dict["\(endpoint)/collections"] = "feedly_collections_addfeed.json"
|
||||
dict["\(category)/global.must"] = "mustread_addfeed.json"
|
||||
dict[collectionsEndpoint] = "feedly_collections_addfeed.json"
|
||||
dict["/global.must"] = "mustread_addfeed.json"
|
||||
transport.testFiles = dict
|
||||
|
||||
case .removeFeed:
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{"id":"user/f2f031bd-f3e3-4893-a447-467a291c6d1e/tag/global.saved","items":[{"originId":"https://inessential.com/2019/10/14/netnewswire_os_compatibility_strategy","fingerprint":"fa6e6fff","id":"+jHfsXnBCVfCstSIW1WDumAyigT4rnsUPnI5WFxgnAU=_16dccdfc972:a6e5:d4506071","summary":{"direction":"ltr","content":"<p>We have two goals with the app: 1) get as many people using RSS as possible, and 2) make the best app we can.</p>\n<p>To reach #2 — making the best app we can — we need to do a couple things. One is stay modern: use new APIs and tools that make the app better and easier to maintain. A second is to not spend time on things that don’t make the app better. A third is to attract and retain contributors, who are usually more psyched to work with modern stuff than with old stuff.</p>\n<p>You can see how that’s in a little bit of conflict with #1 (getting as many people as possible using RSS readers).</p>\n<h4>Here’s the plan</h4>\n<p>After a major OS update, we will switch to requiring that update on our next major release — where major is defined as something like 5.0 or 5.1, but not something like 5.0.1. (In other words: the upcoming NetNewsWire 5.0.3 release will run on Mojave, while NetNewsWire 5.1 will require Catalina.)</p>\n<p>At the same time, we will make older versions available via the website. For instance, the last version that will run on Mojave will likely be 5.0.4 (which isn’t finished yet) — and we’ll make that version available indefinitely for people who haven’t upgraded to Catalina.</p>\n<p>This will mean that people running older OSes will still get a high-quality app — it’s just that it won’t have the latest features.</p>\n<p>The key is that this allows us to make NetNewsWire the best app it can be, and making the best app we can is also part of furthering the goal of getting as many people as possible using RSS. (The biggest part, in fact. Bigger than compatibility with older OSes.)</p>\n<p>While I know this will disappoint some people, I hope you’ll understand <em>why</em> we decided to do it this way. Decisions like this are never easy — there are always conflicting values to weigh, pros and cons and add up — and we don’t make them impulsively. But making NetNewsWire the best app it can be has to be job #1.</p>"},"alternate":[{"href":"https://inessential.com/2019/10/14/netnewswire_os_compatibility_strategy","type":"text/html"}],"crawled":1571100281202,"title":"NetNewsWire OS Compatibility Strategy","published":1571099404000,"origin":{"streamId":"feed/http://ranchero.com/xml/rss.xml","htmlUrl":"https://inessential.com/","title":"inessential.com"},"unread":false,"categories":[{"id":"user/f2f031bd-f3e3-4893-a447-467a291c6d1e/category/66132046-6f14-488d-b590-8e93422723c8","label":"THree"}],"tags":[{"id":"user/f2f031bd-f3e3-4893-a447-467a291c6d1e/tag/global.saved","label":"Saved For Later"},{"id":"user/f2f031bd-f3e3-4893-a447-467a291c6d1e/tag/global.read","label":""}],"actionTimestamp":1571123677415},{"keywords":["Xcode"],"originId":"https://nshipster.com/swiftui-previews","fingerprint":"e3a6f78b","id":"08l+9ftpGejQ9f/2DZ6dom5rSnNJJO9OCox6I3nUnWg=_16dc8d7749a:96ed:d4506071","updated":1571036400000,"author":"Mattt","summary":{"direction":"ltr","content":"<p>Working on a large iOS codebase often involves a lot of waiting. But with Xcode 11, our wait is finally over — and it’s all thanks to SwiftUI.</p>"},"alternate":[{"href":"https://nshipster.com/swiftui-previews/","type":"text/html"}],"crawled":1571032626330,"title":"SwiftUI Previews on macOS Catalina and Xcode 11","published":1571036400000,"origin":{"streamId":"feed/http://nshipster.com/feed.xml","htmlUrl":"https://nshipster.com/","title":"NSHipster"},"content":{"direction":"ltr","content":"<p>Working on a large iOS codebase often involves a lot of waiting:\nWaiting for Xcode to index your files,\nwaiting for Swift and Objective-C code to compile,\nwaiting for the Simulator to boot and your app to launch…</p>\n<p>And after all of that,\nyou spend even more time getting your app\ninto a particular state and onto a particular screen,\njust to see whether the Auto Layout constraint you just added\nfixes that regression you found.\nIt didn’t, of course,\nso you jump back into Xcode,\ntweak the Content Hugging Priority,\nhit <kbd>⌘</kbd><kbd>R</kbd>,\nand start the whole process again.</p>\n<p>We might relate our sorry predicament to\n<a rel=\"noopener noreferrer\" href=\"https://xkcd.com/303/\">that one xkcd comic</a>,\nbut for those of us who don’t so much relish in\nthe stop-and-go nature of app development,\nthere’s an old Yiddish joke about Shlemiel the painter\n<em>(provided below with a few -specific modifications;\nfor the uninitiated,\nplease refer to Joel Spolsky’s\n<a rel=\"noopener noreferrer\" href=\"https://www.joelonsoftware.com/2001/12/11/back-to-basics/\">original telling</a>)</em>:</p>\n<blockquote>\n<p>Shlemiel gets a job as a software developer,\nimplementing a new iOLine truncated
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
import Foundation
|
||||
import RSWeb
|
||||
import XCTest
|
||||
|
||||
final class TestTransport: Transport {
|
||||
|
||||
@@ -50,13 +51,20 @@ final class TestTransport: Transport {
|
||||
|
||||
let response = httpResponse(for: request, statusCode: testStatusCodes[urlString] ?? 200)
|
||||
|
||||
if let testFileName = testFiles[urlString] {
|
||||
var mockResponseFound = false
|
||||
for (key, testFileName) in testFiles where urlString.contains(key) {
|
||||
let testFileURL = Bundle(for: TestTransport.self).resourceURL!.appendingPathComponent(testFileName)
|
||||
let data = try! Data(contentsOf: testFileURL)
|
||||
DispatchQueue.global(qos: .background).async {
|
||||
completion(.success((response, data)))
|
||||
}
|
||||
} else {
|
||||
mockResponseFound = true
|
||||
break
|
||||
}
|
||||
|
||||
if !mockResponseFound {
|
||||
// XCTFail("Missing mock response for: \(urlString)")
|
||||
print("***\nWARNING: \(self) missing mock response for:\n\(urlString)\n***")
|
||||
DispatchQueue.global(qos: .background).async {
|
||||
completion(.success((response, nil)))
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user