def test_get_links(self, mock_time): mock_time.utcnow.return_value = MOCKED_TIME iso8601_urlencoded = '%Y-%m-%dT%H:%M:%SZ'.replace(':', '%%3A') r_start = ( MOCKED_TIME + timedelta(minutes=settings.RESULT_RANGE_START) ).strftime(iso8601_urlencoded) r_end = ( MOCKED_TIME + timedelta(minutes=settings.RESULT_RANGE_END) ).strftime(iso8601_urlencoded) alamo_api_url = ( 'http://alamo.example.com' '/checks/e2e1ec23-707a-4382-a956-f0cf3276a1b8/' '?triggers=e2e1ec23-707a-4382-a956-f0cf3276a1b8' '&from={}&until={}' ).format(r_start, r_end) expected = { 'alamo_api_url': { 'href': alamo_api_url, 'type': 'link' }, 'trigger_url': { 'href': 'http://example.com/' '#/999/entity/888/check/982/?triggerId=2492', 'type': 'link' } } notification = HttpNotificationClient() result = notification.get_links( self.check.uuid, self.check.triggers[0] ) self.assertDictEqual(result, expected)