use newer bulk endpoint with current user in path

This commit is contained in:
Alan Hamlett 2017-11-09 07:31:28 -08:00
parent 2266f3c261
commit 2b2c48b2d7
3 changed files with 3 additions and 3 deletions

View file

@ -145,7 +145,7 @@ class LoggingTestCase(utils.TestCase):
if self.isPy35OrNewer:
expected = u('WakaTime WARNING Regex error (unbalanced parenthesis at position 15) for exclude pattern: \\(invalid regex)')
self.assertEquals(output[1], expected)
self.assertEquals(output[2], u('WakaTime DEBUG Sending heartbeats to api at https://api.wakatime.com/api/v1/heartbeats.bulk'))
self.assertEquals(output[2], u('WakaTime DEBUG Sending heartbeats to api at https://api.wakatime.com/api/v1/users/current/heartbeats.bulk'))
self.assertIn('Python', output[3])
self.assertIn('response_code', output[4])

View file

@ -219,7 +219,7 @@ class MainTestCase(utils.TestCase):
actual = self.getLogOutput(logs)
expected = 'Parsing dependencies not supported for special.TextParser'
self.assertIn(expected, actual)
expected = 'WakaTime DEBUG Sending heartbeats to api at https://api.wakatime.com/api/v1/heartbeats.bulk'
expected = 'WakaTime DEBUG Sending heartbeats to api at https://api.wakatime.com/api/v1/users/current/heartbeats.bulk'
self.assertIn(expected, actual)
expected = "RequestException': u'requests exception'"
if is_py3:

View file

@ -49,7 +49,7 @@ def send_heartbeats(heartbeats, args, configs, use_ntlm_proxy=False):
api_url = args.api_url
if not api_url:
api_url = 'https://api.wakatime.com/api/v1/heartbeats.bulk'
api_url = 'https://api.wakatime.com/api/v1/users/current/heartbeats.bulk'
log.debug('Sending heartbeats to api at %s' % api_url)
timeout = args.timeout
if not timeout: