                 print("User (\(self.userName)) already exists")
             }
         }
-        
+
         deinit {
             attempt {
                 let request = IAM.DeleteUserRequest(userName: self.userName)

    }

    //MARK: TESTS
    
    func testCreateDeleteUser() {
        attempt {
            let testData = try TestData(#function, client: client)

            policyDocument = policyDocument.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines)
            let getUserRequest = IAM.GetUserRequest(userName: testData.userName)
            let getUserResponse = try client.getUser(getUserRequest).wait()

            let putRequest = IAM.PutUserPolicyRequest(policyDocument: policyDocument, policyName: "testSetGetPolicy", userName: getUserResponse.user.userName)
            _ = try client.putUserPolicy(putRequest).wait()

            let getRequest = IAM.GetUserPolicyRequest(policyName: "testSetGetPolicy", userName: getUserResponse.user.userName)
            let getResponse = try client.getUserPolicy(getRequest).wait()

            XCTAssertEqual(getResponse.policyDocument.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines), policyDocument.trimmingCharacters(in: CharacterSet.whitespacesAndNewlines))

            let deletePolicy = IAM.DeleteUserPolicyRequest(policyName: "testSetGetPolicy", userName: getUserResponse.user.userName)
            try client.deleteUserPolicy(deletePolicy).wait()
        }

    }

    static var allTests : [(String, (IAMTests) -> () throws -> Void)] {
        return [
            ("testCreateDeleteUser", testCreateDeleteUser),
            ("testSetGetPolicy", testSetGetPolicy),
        ]
    }
}
