Test Omni Show and Macworld unique IDs. The Omni Show ids should come from the feed’s guids. Macworld’s unique IDs should be calculated, since the feed doesn’t have guids.
This commit is contained in:
parent
fefa96d259
commit
b380d0597f
|
@ -71,7 +71,7 @@ class RSSParserTests: XCTestCase {
|
|||
}
|
||||
}
|
||||
|
||||
func testTheOmniShow() {
|
||||
func testTheOmniShowUniqueIDs() {
|
||||
|
||||
let d = parserData("theomnishow", "rss", "https://theomnishow.omnigroup.com/")
|
||||
let parsedFeed = try! FeedParser.parse(d)!
|
||||
|
@ -81,4 +81,18 @@ class RSSParserTests: XCTestCase {
|
|||
XCTAssertTrue(article.uniqueID.hasPrefix("https://theomnishow.omnigroup.com/episode/"))
|
||||
}
|
||||
}
|
||||
|
||||
func testMacworldUniqueIDs() {
|
||||
|
||||
// Macworld’s feed doesn’t have guids, so they should be calculated unique IDs.
|
||||
|
||||
let d = parserData("macworld", "rss", "https://www.macworld.com/")
|
||||
let parsedFeed = try! FeedParser.parse(d)!
|
||||
|
||||
for article in parsedFeed.items {
|
||||
XCTAssertNotNil(article.uniqueID)
|
||||
XCTAssertEqual(article.uniqueID.count, 32) // calculated unique IDs are MD5 hashes
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue