|
11 | 11 | from constructor_io.helpers.exception import (ConstructorException, |
12 | 12 | HttpException) |
13 | 13 |
|
14 | | -TEST_API_KEY = environ['TEST_API_KEY'] |
| 14 | +TEST_API_KEY = environ['TEST_REQUEST_API_KEY'] |
15 | 15 | TEST_API_TOKEN = environ['TEST_API_TOKEN'] |
16 | 16 | VALID_CLIENT_ID = '2b23dd74-5672-4379-878c-9182938d2710' |
17 | 17 | VALID_SESSION_ID = 2 |
@@ -171,7 +171,8 @@ def test_get_browse_results_with_valid_filter_name_filter_value_and_fmt_options( |
171 | 171 | assert isinstance(response.get('request'), dict) |
172 | 172 | assert isinstance(response.get('response'), dict) |
173 | 173 | assert isinstance(response.get('result_id'), str) |
174 | | - assert response.get('request').get('fmt_options') == fmt_options |
| 174 | + assert response.get('request').get('fmt_options').get('groups_max_depth') == 2 |
| 175 | + assert response.get('request').get('fmt_options').get('groups_start') == 'current' |
175 | 176 |
|
176 | 177 |
|
177 | 178 | def test_get_browse_results_with_valid_filter_name_filter_value_and_sort_by(): |
@@ -480,7 +481,7 @@ def test_get_browse_results_with_invalid_api_key(): |
480 | 481 |
|
481 | 482 | with raises( |
482 | 483 | HttpException, |
483 | | - match=r'We have no record of this key. You can find your key at app.constructor.io/dashboard.' # pylint: disable=line-too-long |
| 484 | + match=r'You have supplied an invalid `key` or `autocomplete_key`. You can find your key at app.constructor.io/dashboard/accounts/api_integration.' # pylint: disable=line-too-long |
484 | 485 | ): |
485 | 486 | browse = ConstructorIO({ |
486 | 487 | **VALID_OPTIONS, |
@@ -624,7 +625,7 @@ def test_get_browse_groups_with_invalid_fmt_options(): |
624 | 625 | def test_get_browse_groups_with_invalid_api_key(): |
625 | 626 | '''Should return a response with invalid api_key''' |
626 | 627 |
|
627 | | - with raises(HttpException, match=r'We have no record of this key. You can find your key at app.constructor.io/dashboard.'): # pylint: disable=line-too-long |
| 628 | + with raises(HttpException, match=r'You have supplied an invalid `key` or `autocomplete_key`. You can find your key at app.constructor.io/dashboard/accounts/api_integration.'): # pylint: disable=line-too-long |
628 | 629 | browse = ConstructorIO({'api_key': 'fyzs7tfF8L161VoAXQ8u'}).browse |
629 | 630 | browse.get_browse_groups() |
630 | 631 |
|
@@ -734,7 +735,7 @@ def test_get_browse_facets_with_invalid_fmt_options(): |
734 | 735 | def test_get_browse_facets_with_invalid_api_key(): |
735 | 736 | '''Should return a response with invalid api_key''' |
736 | 737 |
|
737 | | - with raises(HttpException, match=r'We have no record of this key. You can find your key at app.constructor.io/dashboard.'): # pylint: disable=line-too-long |
| 738 | + with raises(HttpException, match=r'You have supplied an invalid `key` or `autocomplete_key`. You can find your key at app.constructor.io/dashboard/accounts/api_integration.'): # pylint: disable=line-too-long |
738 | 739 | browse = ConstructorIO({'api_key': 'fyzs7tfF8L161VoAXQ8u'}).browse |
739 | 740 | browse.get_browse_facets() |
740 | 741 |
|
@@ -880,7 +881,8 @@ def test_get_browse_results_for_item_ids_with_valid_item_ids_and_fmt_options(): |
880 | 881 | assert isinstance(response.get('response'), dict) |
881 | 882 | assert isinstance(response.get('result_id'), str) |
882 | 883 | assert isinstance(response.get('response').get('results'), list) |
883 | | - assert response.get('request').get('fmt_options') == fmt_options |
| 884 | + assert response.get('request').get('fmt_options').get('groups_max_depth') == 2 |
| 885 | + assert response.get('request').get('fmt_options').get('groups_start') == 'current' |
884 | 886 |
|
885 | 887 |
|
886 | 888 | def test_get_browse_results_for_item_ids_with_valid_item_ids_and_sort_by(): |
@@ -1168,7 +1170,7 @@ def test_get_browse_results_for_item_ids_with_invalid_api_key(): |
1168 | 1170 |
|
1169 | 1171 | with raises( |
1170 | 1172 | HttpException, |
1171 | | - match=r'We have no record of this key. You can find your key at app.constructor.io/dashboard.' # pylint: disable=line-too-long |
| 1173 | + match=r'You have supplied an invalid `key` or `autocomplete_key`. You can find your key at app.constructor.io/dashboard/accounts/api_integration.' # pylint: disable=line-too-long |
1172 | 1174 | ): |
1173 | 1175 | browse = ConstructorIO({ |
1174 | 1176 | **VALID_OPTIONS, |
@@ -1278,6 +1280,6 @@ def test_get_browse_facet_options_with_invalid_fmt_options(): |
1278 | 1280 | def test_get_browse_facet_options_with_invalid_api_key(): |
1279 | 1281 | '''Should return a response with invalid api_key''' |
1280 | 1282 |
|
1281 | | - with raises(HttpException, match=r'We have no record of this key. You can find your key at app.constructor.io/dashboard.'): # pylint: disable=line-too-long |
| 1283 | + with raises(HttpException, match=r'You have supplied an invalid `key` or `autocomplete_key`. You can find your key at app.constructor.io/dashboard/accounts/api_integration.'): # pylint: disable=line-too-long |
1282 | 1284 | browse = ConstructorIO({'api_key': 'fyzs7tfF8L161VoAXQ8u'}).browse |
1283 | 1285 | browse.get_browse_facet_options(FACET_NAME) |
0 commit comments