@@ -0,0 +1,2265 @@
+import mock%0Aimport pytest%0Afrom django.core.mail.message import EmailMessage%0A%0Aimport awx.main.notifications.rocketchat_backend as rocketchat_backend%0A%0Adef test_send_messages():%0A    with mock.patch('awx.main.notifications.rocketchat_backend.requests') as requests_mock:%0A        backend = rocketchat_backend.RocketChatBackend()%0A        message = EmailMessage('test subject', 'test body', %5B%5D, %5B'http://example.com', %5D)%0A        sent_messages = backend.send_messages(%5Bmessage, %5D)%0A        requests_mock.post.assert_called_once_with('http://example.com', data='%7B%22text%22: %22test subject%22%7D', verify=True)%0A        assert sent_messages == 1%0A%0Adef test_send_messages_with_username():%0A    with mock.patch('awx.main.notifications.rocketchat_backend.requests') as requests_mock:%0A        backend = rocketchat_backend.RocketChatBackend(rocketchat_username='testuser')%0A        message = EmailMessage('test subject', 'test body', %5B%5D, %5B'http://example.com', %5D)%0A        sent_messages = backend.send_messages(%5Bmessage, %5D)%0A        requests_mock.post.assert_called_once_with('http://example.com', data='%7B%22username%22: %22testuser%22, %22text%22: %22test subject%22%7D', verify=True)%0A        assert sent_messages == 1%0A%0Adef test_send_messages_with_icon_url():%0A    with mock.patch('awx.main.notifications.rocketchat_backend.requests') as requests_mock:%0A        backend = rocketchat_backend.RocketChatBackend(rocketchat_icon_url='http://example.com')%0A        message = EmailMessage('test subject', 'test body', %5B%5D, %5B'http://example.com', %5D)%0A        sent_messages = backend.send_messages(%5Bmessage, %5D)%0A        requests_mock.post.assert_called_once_with('http://example.com', data='%7B%22text%22: %22test subject%22, %22icon_url%22: %22http://example.com%22%7D', verify=True)%0A        assert sent_messages == 1%0A%0Adef test_send_messages_with_no_verify_ssl():%0A    with mock.patch('awx.main.notifications.rocketchat_backend.requests') as requests_mock:%0A        backend = rocketchat_backend.RocketChatBackend(rocketchat_no_verify_ssl=True)%0A        message = EmailMessage('test subject', 'test body', %5B%5D, %5B'http://example.com', %5D)%0A        sent_messages = backend.send_messages(%5Bmessage, %5D)%0A        requests_mock.post.assert_called_once_with('http://example.com', data='%7B%22text%22: %22test subject%22%7D', verify=False)%0A        assert sent_messages == 1%0A

Add unit test for rocket.chat notifications