Exemplo n.º 1
0
def test_send():
    config = get_config().get("config")
    url = "https://hooks.slack.com/services/%s" % config['slack_key']
    slack = SlackMessage().text("test")
    with requests_mock.mock() as m:
        m.post(url, text='resp')
        slack._send()
        assert m.called
        assert m.call_count == 1
        assert m.request_history[0].json()["text"] == "test"
Exemplo n.º 2
0
 def get_enabled_bots():
     bots_enabled = core.get_config().keys()
     bots_enabled.remove('config')
     return bots_enabled