Created S3StorageTests.testWrite test case

This commit is contained in:
Caleb Kleveter 2018-12-14 08:35:35 -06:00
parent c87b05e1e7
commit 9230ac419a
No known key found for this signature in database
GPG Key ID: B38DBD5CF2C98D69
1 changed files with 10 additions and 0 deletions

View File

@ -76,6 +76,15 @@ final class S3StorageTests: XCTestCase {
XCTAssertEqual(file.data, self.data)
}
func testWrite()throws {
let storage = try self.app.make(S3Storage.self)
let updated = try storage.write(file: "markdown/test.md", with: "All new updated data!".data(using: .utf8)!).wait()
XCTAssertEqual(updated.data, "All new updated data!".data(using: .utf8))
XCTAssertEqual(updated.filename, "test.md")
}
func testDelete()throws {
let storage = try self.app.make(S3Storage.self)
try XCTAssertNoThrow(storage.delete(file: "markdown/test.md").wait())
@ -84,6 +93,7 @@ final class S3StorageTests: XCTestCase {
static var allTests: [(String, (S3StorageTests) -> ()throws -> ())] = [
("testStore", testStore),
("testFetch", testFetch),
("testWrite", testWrite),
("testDelete", testDelete)
]
}