Merge lp:~vila/ols-store-tests/fix-arch-requirement into lp:~ubuntuone-pqm-team/ols-store-tests/store-acceptance-tests

Proposed by Vincent Ladeuil
Status: Merged
Approved by: Vincent Ladeuil
Approved revision: 46
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: lp:~vila/ols-store-tests/fix-arch-requirement
Merge into: lp:~ubuntuone-pqm-team/ols-store-tests/store-acceptance-tests
Diff against target: 49 lines (+11/-6)
1 file modified
tests/api/cpi/test_snaps.py (+11/-6)
To merge this branch: bzr merge lp:~vila/ols-store-tests/fix-arch-requirement
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+321818@code.launchpad.net

Commit message

X-Ubuntu-Architecture requirement is more precise now.

Description of the change

X-Ubuntu-Architecture requirement is more precise now.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tests/api/cpi/test_snaps.py'
--- tests/api/cpi/test_snaps.py 2017-03-21 10:05:43 +0000
+++ tests/api/cpi/test_snaps.py 2017-04-04 07:31:37 +0000
@@ -11,7 +11,7 @@
11from .test_search import SearchTestCase11from .test_search import SearchTestCase
1212
1313
14def get_snap_detail(name, series='16', arch='amd64', auth=False):14def get_snap_detail(name, series='16', arch='amd64', auth=False, params=None):
15 url = '{}/api/v1/snaps/details/{}'.format(CPI_ROOT_URL, name)15 url = '{}/api/v1/snaps/details/{}'.format(CPI_ROOT_URL, name)
16 headers = {}16 headers = {}
17 if arch:17 if arch:
@@ -20,14 +20,16 @@
20 headers['X-Ubuntu-Series'] = series20 headers['X-Ubuntu-Series'] = series
21 if auth:21 if auth:
22 with get_oauth_client() as client:22 with get_oauth_client() as client:
23 response = client.get(url, headers=headers)23 response = client.get(url, headers=headers, params=params)
24 else:24 else:
25 response = requests.get(url, headers=headers)25 response = requests.get(url, headers=headers, params=params)
26 return response26 return response
2727
2828
29class SnapDetailTestCase(APITestCase):29class SnapDetailTestCase(APITestCase):
3030
31 maxDiff = None
32
31 def assert_snap_detail(self, response, name):33 def assert_snap_detail(self, response, name):
32 body = response.json()34 body = response.json()
33 fields = [35 fields = [
@@ -106,11 +108,14 @@
106 message='X-Ubuntu-Series header is required.',108 message='X-Ubuntu-Series header is required.',
107 new_style_error=True)109 new_style_error=True)
108110
109 def test_get_snap_detail_without_arch(self):111 def test_get_snap_detail_with_channel_maps_without_arch(self):
110 response = get_snap_detail(SNAP_PACKAGE_NAME, arch=None)112 response = get_snap_detail(
113 SNAP_PACKAGE_NAME, arch=None,
114 params={'fields': 'name,channel,channel_maps_list'})
111 self.assert_bad_request(115 self.assert_bad_request(
112 response, code='missing-header',116 response, code='missing-header',
113 message='X-Ubuntu-Architecture header is required.',117 message=('X-Ubuntu-Architecture header is mandatory when'
118 ' the channel_maps_list field is requested'),
114 new_style_error=True)119 new_style_error=True)
115120
116 def test_get_snap_detail_unauthorized(self):121 def test_get_snap_detail_unauthorized(self):

Subscribers

People subscribed via source and target branches