-
Notifications
You must be signed in to change notification settings - Fork 8
Use MuxUpload id instead if the input URL when looking up or writing … #31
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Use MuxUpload id instead if the input URL when looking up or writing … #31
Conversation
a2c0604
to
ec6ea05
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the changes!
@daytime-em will be adding a few more changes here Changed the |
// Shouldn't throw (but not specifically part of the test) | ||
try! persistence.write(entry: e1, forFileAt: makeDummyFileURL(basename: "e1")) | ||
try! persistence.write(entry: e2, forFileAt: makeDummyFileURL(basename: "e2")) | ||
XCTAssertNoThrow( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
XCTAssertNoThrow
is effectively the same as try!
(the test will fail and throw either way if this expression throws). One bonus behind asserting here is it does also allow us to pass a string that gets printed when a specific assertion fails.
let readItem1 = try XCTUnwrap( | ||
persistence.readEntry(uploadID: e2.uploadInfo.id) | ||
) | ||
let readItem2 = try XCTUnwrap( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Converts what is otherwise a crash into a failing test. More here: https://useyourloaf.com/blog/xctunwrap-optionals-in-your-tests/
e1.uploadInfo.videoFile, | ||
"read() should return the right item" | ||
) | ||
XCTAssertEqual( | ||
// remember, they're swapped | ||
readItem1!.uploadInfo.videoFile, | ||
readItem1.uploadInfo.videoFile, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The !
can now be removed due to the XCTUnwrap
above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
…state in the SDK