Added parameters for PLPython functions
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
import unittest
|
||||
from mock import Mock
|
||||
from cartodb_services.mapbox import MapboxMatrixClient
|
||||
from cartodb_services.mapbox.matrix_client import DEFAULT_PROFILE
|
||||
from cartodb_services.mapbox import ServiceException
|
||||
from cartodb_services.tools import Coordinate
|
||||
|
||||
VALID_TOKEN = 'pk.eyJ1IjoiYWNhcmxvbiIsImEiOiJjamJuZjQ1Zjc0Ymt4Mnh0YmFrMmhtYnY4In0.gt9cw0VeKc3rM2mV5pcEmg'
|
||||
INVALID_TOKEN = 'invalid_token'
|
||||
VALID_ORIGIN = Coordinate(-73.989, 40.733)
|
||||
VALID_TARGET = Coordinate(-74, 40.733)
|
||||
@@ -20,7 +22,8 @@ INVALID_PROFILE = 'invalid_profile'
|
||||
|
||||
class MapboxMatrixTestCase(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.matrix_client = MapboxMatrixClient()
|
||||
self.matrix_client = MapboxMatrixClient(token=VALID_TOKEN,
|
||||
logger=Mock())
|
||||
|
||||
def test_invalid_profile(self):
|
||||
with self.assertRaises(ValueError):
|
||||
@@ -43,7 +46,7 @@ class MapboxMatrixTestCase(unittest.TestCase):
|
||||
VALID_PROFILE)
|
||||
|
||||
def test_invalid_token(self):
|
||||
invalid_matrix = MapboxMatrixClient(token=INVALID_TOKEN)
|
||||
invalid_matrix = MapboxMatrixClient(token=INVALID_TOKEN, logger=Mock())
|
||||
with self.assertRaises(ServiceException):
|
||||
invalid_matrix.matrix(VALID_COORDINATES,
|
||||
VALID_PROFILE)
|
||||
|
||||
Reference in New Issue
Block a user