Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion ringcentral/platform/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
# encoding: utf-8

import sys
import urllib.parse
try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse
from observable import Observable
from functools import reduce
from .auth import Auth
Expand All @@ -21,6 +24,7 @@
KNOWN_PREFIXES = [
URL_PREFIX,
'/rcvideo',
'/analytics',
'/scim'
]

Expand Down
15 changes: 15 additions & 0 deletions ringcentral/platform/platform_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ def test_login_code(self, mock):
else:
self.assertEqual(text, 'code=foo&grant_type=authorization_code&redirect_uri=mock%3A%2F%2Fwhatever-redirect')

def test_login_fail(self, mock):
sdk = self.get_sdk(mock)
self.logout_mock(mock)
sdk.platform().logout()
self.authentication_mock(mock)
try:
sdk.platform().login()
except Exception as e:
self.assertTrue( e )

def test_login_code_redirect(self, mock):
sdk = self.get_sdk(mock)
self.logout_mock(mock)
Expand Down Expand Up @@ -129,6 +139,11 @@ def test_api_url_custom_prefixes(self, mock):
act = sdk.platform().create_url(url, add_server=True)
self.assertEqual(exp, act)

exp = 'mock://whatever/analytics/phone/foo'
url = '/analytics/phone/foo'
act = sdk.platform().create_url(url, add_server=True)
self.assertEqual(exp, act)


if __name__ == '__main__':
unittest.main()
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import setup, find_packages

VERSION = '0.7.12'
VERSION = '0.7.13'

setup(
name='ringcentral',
Expand Down