Skip to content

Commit

Permalink
Update file download tests
Browse files Browse the repository at this point in the history
  • Loading branch information
staskus committed Jun 5, 2024
1 parent 1c4d187 commit 0e3a287
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
12 changes: 8 additions & 4 deletions Tests/WordPressKitTests/Mock Data/stats-file-downloads.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@
"2019-07-01": {
"files": [
{
"filename": "/2019/07/test.pdf",
"downloads": 11
"filename": "test.pdf",
"downloads": 11,
"relative_url": "/2019/07/test.pdf",
"download_url": "https://testsite.com/2019/07/test.pdf"
},
{
"filename": "/2019/07/sampleaudio.mp3",
"downloads": 4
"filename": "sampleaudio.mp3",
"downloads": 4,
"relative_url": "/2019/07/sampleaudio.mp3",
"download_url": "https://testsite.com/2019/07/sampleaudio.mp3"
}
],
"other_downloads": 0,
Expand Down
3 changes: 2 additions & 1 deletion Tests/WordPressKitTests/Tests/StatsRemoteV2Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,8 @@ class StatsRemoteV2Tests: RemoteTestCase, RESTTestable {

XCTAssertEqual(fileDownloads?.fileDownloads.count, 2)

XCTAssertEqual(fileDownloads?.fileDownloads.first!.file, "/2019/07/test.pdf")
XCTAssertEqual(fileDownloads?.fileDownloads.first!.file, "test.pdf")
XCTAssertEqual(fileDownloads?.fileDownloads.first!.downloadURL, URL(string: "https://testsite.com/2019/07/test.pdf"))
XCTAssertEqual(fileDownloads?.fileDownloads.first!.downloadCount, 11)

expect.fulfill()
Expand Down

0 comments on commit 0e3a287

Please sign in to comment.