-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from Yelp/release_1_0_1
Release 1.0.1 on pypi, bringing master up to date
- Loading branch information
Showing
19 changed files
with
383 additions
and
305 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
coverage==4.0 | ||
mock==1.3.0 | ||
pre-commit==0.6.0 | ||
pre-commit==0.7.6 | ||
pytest==2.8.1 | ||
vcrpy==1.7.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# -*- coding: UTF-8 -*- | ||
import mock | ||
|
||
from yelp.client import Client | ||
from yelp.obj.business_response import BusinessResponse | ||
|
||
|
||
class TestBusiness(object): | ||
|
||
@classmethod | ||
def setup_class(cls): | ||
auth = mock.Mock() | ||
cls.client = Client(auth) | ||
|
||
def test_get_business_builds_correct_params(self): | ||
with mock.patch('yelp.client.Client._make_request') as request: | ||
request.return_value = '{}' | ||
response = self.client.get_business('test-id') | ||
request.assert_called_once_with('/v2/business/test-id', {}) | ||
assert type(response) is BusinessResponse | ||
|
||
def test_get_business_builds_correct_params_with_lang(self): | ||
with mock.patch('yelp.client.Client._make_request') as request: | ||
params = {'lang': 'fr'} | ||
self.client.get_business('test-id', **params) | ||
request.assert_called_once_with('/v2/business/test-id', params) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# -*- coding: UTF-8 -*- | ||
import mock | ||
|
||
from yelp.client import Client | ||
from yelp.obj.search_response import SearchResponse | ||
|
||
|
||
class TestBusiness(object): | ||
|
||
@classmethod | ||
def setup_class(cls): | ||
auth = mock.Mock() | ||
cls.client = Client(auth) | ||
|
||
def test_phone_search_builds_correct_params(self): | ||
with mock.patch('yelp.client.Client._make_request') as request: | ||
request.return_value = '{}' | ||
params = { | ||
'category': 'fashion' | ||
} | ||
response = self.client.phone_search('5555555555', **params) | ||
params['phone'] = '5555555555' | ||
request.assert_called_once_with('/v2/phone_search/', params) | ||
assert type(response) is SearchResponse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# -*- coding: UTF-8 -*- | ||
import mock | ||
|
||
from yelp.client import Client | ||
from yelp.obj.search_response import SearchResponse | ||
|
||
|
||
class TestBusiness(object): | ||
|
||
sample_location = 'San Francisco, CA' | ||
|
||
@classmethod | ||
def setup_class(cls): | ||
auth = mock.Mock() | ||
cls.client = Client(auth) | ||
|
||
def test_search_builds_correct_params(self): | ||
with mock.patch('yelp.client.Client._make_request') as request: | ||
request.return_value = '{}' | ||
params = { | ||
'term': 'food', | ||
} | ||
response = self.client.search(self.sample_location, **params) | ||
params.update({ | ||
'location': self.sample_location | ||
}) | ||
request.assert_called_once_with('/v2/search/', params) | ||
assert type(response) is SearchResponse | ||
|
||
def test_search_builds_correct_params_with_current_lat_long(self): | ||
with mock.patch('yelp.client.Client._make_request') as request: | ||
params = { | ||
'term': 'food', | ||
} | ||
self.client.search(self.sample_location, 0, 0, **params) | ||
params.update({ | ||
'location': self.sample_location, | ||
'cll': '0,0' | ||
}) | ||
request.assert_called_once_with('/v2/search/', params) | ||
|
||
def test_search_by_bounding_box_builds_correct_params(self): | ||
with mock.patch('yelp.client.Client._make_request') as request: | ||
params = { | ||
'term': 'food', | ||
} | ||
self.client.search_by_bounding_box(0, 0, 0, 0, **params) | ||
params['bounds'] = '0,0|0,0' | ||
request.assert_called_once_with('/v2/search/', params) | ||
|
||
def test_search_by_coordinates_builds_correct_params(self): | ||
with mock.patch('yelp.client.Client._make_request') as request: | ||
self.client.search_by_coordinates(0, 0, 0, 0, 0) | ||
request.assert_called_once_with('/v2/search/', {'ll': '0,0,0,0,0'}) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.