def test_jira_match_does_async(reactor): client = Mock() settings_stub.JIRA_SHOW_FULL_DESCRIPTION = True urls = {'foo-123': 'http://example.com/foo-123'} expected_call = call(0, jira.jira_full_descriptions, client, '#bots', urls) with pytest.raises(ResponseNotReady): jira.jira_match(client, '#bots', 'me', 'ticket foo-123', ['foo-123']) assert reactor.callLater.call_args == expected_call
def test_jira_match_handles_unicode(): snowman = u'☃' expected = u'me might be talking about JIRA ticket: http://example.com/{0}'.format( snowman) response = jira.jira_match(None, '#bots', 'me', u'this is about {0}'.format(snowman), [snowman]) assert response == expected
def test_jira_match_multiple(): resp = jira.jira_match(None, '#bots', 'me', 'foo-123 and bar-456', ['foo-123', 'bar-456']) assert 'http://example.com/foo-123' in resp assert 'http://example.com/bar-456' in resp
def test_jira_match(): expected = 'me might be talking about JIRA ticket: http://example.com/foo-123' assert expected == jira.jira_match(None, '#bots', 'me', 'this is about foo-123', ['foo-123'])
def test_jira_match_handles_unicode(): snowman = u'☃' expected = u'me might be talking about JIRA ticket: http://example.com/{0}'.format(snowman) response = jira.jira_match(None, '#bots', 'me', u'this is about {0}'.format(snowman), [snowman]) assert response == expected
def test_jira_match_multiple(): resp = jira.jira_match(None, "#bots", "me", "foo-123 and bar-456", ["foo-123", "bar-456"]) assert "http://example.com/foo-123" in resp assert "http://example.com/bar-456" in resp
def test_jira_match(): expected = "me might be talking about JIRA ticket: http://example.com/foo-123" assert expected == jira.jira_match(None, "#bots", "me", "this is about foo-123", ["foo-123"])