| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved | 2 # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved |
| 3 # | 3 # |
| 4 # Permission is hereby granted, free of charge, to any person obtaining a | 4 # Permission is hereby granted, free of charge, to any person obtaining a |
| 5 # copy of this software and associated documentation files (the | 5 # copy of this software and associated documentation files (the |
| 6 # "Software"), to deal in the Software without restriction, including | 6 # "Software"), to deal in the Software without restriction, including |
| 7 # without limitation the rights to use, copy, modify, merge, publish, dis- | 7 # without limitation the rights to use, copy, modify, merge, publish, dis- |
| 8 # tribute, sublicense, and/or sell copies of the Software, and to permit | 8 # tribute, sublicense, and/or sell copies of the Software, and to permit |
| 9 # persons to whom the Software is furnished to do so, subject to the fol- | 9 # persons to whom the Software is furnished to do so, subject to the fol- |
| 10 # lowing conditions: | 10 # lowing conditions: |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 target_arn='target_arn' | 218 target_arn='target_arn' |
| 219 ) | 219 ) |
| 220 self.assert_request_parameters({ | 220 self.assert_request_parameters({ |
| 221 'Action': 'Publish', | 221 'Action': 'Publish', |
| 222 'TargetArn': 'target_arn', | 222 'TargetArn': 'target_arn', |
| 223 'Subject': 'subject', | 223 'Subject': 'subject', |
| 224 'Message': '{"default": "Ignored.", "GCM": {"data": "goes here"}}', | 224 'Message': '{"default": "Ignored.", "GCM": {"data": "goes here"}}', |
| 225 'MessageStructure': 'json', | 225 'MessageStructure': 'json', |
| 226 }, ignore_params_values=['Version', 'ContentType']) | 226 }, ignore_params_values=['Version', 'ContentType']) |
| 227 | 227 |
| 228 def test_publish_with_utf8_message(self): |
| 229 self.set_http_response(status_code=200) |
| 230 subject = message = u'We \u2665 utf-8'.encode('utf-8') |
| 231 self.service_connection.publish('topic', message, subject) |
| 232 self.assert_request_parameters({ |
| 233 'Action': 'Publish', |
| 234 'TopicArn': 'topic', |
| 235 'Subject': subject, |
| 236 'Message': message, |
| 237 }, ignore_params_values=['Version', 'ContentType']) |
| 238 |
| 228 | 239 |
| 229 if __name__ == '__main__': | 240 if __name__ == '__main__': |
| 230 unittest.main() | 241 unittest.main() |
| OLD | NEW |