Merge lp:~rharding/charmworld/move-bundle-url into lp:charmworld
- move-bundle-url
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Richard Harding |
Approved revision: | 445 |
Merged at revision: | 442 |
Proposed branch: | lp:~rharding/charmworld/move-bundle-url |
Merge into: | lp:charmworld |
Diff against target: |
255 lines (+44/-25) 5 files modified
charmworld/routes.py (+4/-4) charmworld/views/api/__init__.py (+14/-5) charmworld/views/tests/test_api.py (+14/-10) charmworld/views/tests/test_bundles.py (+6/-6) charmworld/views/tests/test_misc.py (+6/-0) |
To merge this branch: | bzr merge lp:~rharding/charmworld/move-bundle-url |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Gui Bot | continuous-integration | Approve | |
Charmworld Developers | Pending | ||
Review via email: mp+193851@code.launchpad.net |
Commit message
Update bundle user url to be /bundle/$id-bits.
- Update the api to provide that url as part of the bundle metadata so the gui
can link to it as a valid quickstart end point.
- Drive by to skip the test that fails with the known bug issue.
- Rename the TestApi2 and 3 back to not have the Z since we're just skipping
vs working around the issue.
https:/
R=benji
Description of the change
Update bundle user url to be /bundle/$id-bits.
- Update the api to provide that url as part of the bundle metadata so the gui
can link to it as a valid quickstart end point.
- Drive by to skip the test that fails with the known bug issue.
- Rename the TestApi2 and 3 back to not have the Z since we're just skipping
vs working around the issue.
Richard Harding (rharding) wrote : | # |
- 442. By Richard Harding
-
Update per self-review
- 443. By Richard Harding
-
lint
Richard Harding (rharding) wrote : | # |
Please take a look.
Richard Harding (rharding) wrote : | # |
Reviewer comments added.
https:/
File charmworld/
https:/
charmworld/
"/bundle/
this could probably go into some sort of /bundle/*bits but leaving as
simple case of moving the url for the moment.
https:/
File charmworld/
https:/
charmworld/
db, route_url):
route_url is needed to build the url to the person bundle json route
we're providing as an endpoint for the deployer/quickstart to use.
https:/
File charmworld/
https:/
charmworld/
because of the need to generate the route for the deployer_file_url we
need to enable routes on more tests.
https:/
charmworld/
u'http://
I'm so sorry, but the linter...he hates me.
https:/
charmworld/
API3Mixin):
remove the stupid Z. Just skipping the bad test for now. See later
files.
https:/
File charmworld/
https:/
charmworld/
#1237025")
Skipping this as the new enable_routes() caused it to fail over here for
no good reason. Will look at as a follow up after bundles are released.
Benji York (benji) wrote : | # |
LGTM
https:/
File charmworld/
https:/
charmworld/
"/bundle/
On 2013/11/04 21:46:34, rharding wrote:
> this could probably go into some sort of /bundle/*bits but leaving as
simple
> case of moving the url for the moment.
If I'm understanding you correctly, I think I like it better this way.
It is easier to see the pattern matching spelled out in routes rather
than in code.
https:/
File charmworld/
https:/
charmworld/
**route_info)
Since route_info isn't used subsequently, I don't see why it is created
instead of just passing its contents as keyword arguments.
https:/
File charmworld/
https:/
charmworld/
description here if sensible> 2012, 2013 Canonical
Something bad happened here.
https:/
charmworld/
u'http://
On 2013/11/04 21:46:34, rharding wrote:
> I'm so sorry, but the linter...he hates me.
Eww. That is bad.
It wouldn't accept the value being indented four more spaces?
https:/
charmworld/
API3Mixin):
On 2013/11/04 21:46:34, rharding wrote:
> remove the stupid Z. Just skipping the bad test for now. See later
files.
I like the explicitness of the new approach better.
Richard Harding (rharding) wrote : | # |
Thanks for the review. I made a couple of small updates.
https:/
File charmworld/
https:/
charmworld/
u'http://
On 2013/11/05 12:55:46, benji wrote:
> On 2013/11/04 21:46:34, rharding wrote:
> > I'm so sorry, but the linter...he hates me.
> Eww. That is bad.
> It wouldn't accept the value being indented four more spaces?
No, it yelled about bad indentation. I was trapped between the line
length and the indentation fussing. I moved the string out into a
variable. I thought about it yesterday but it seemed ugly to me. Now
looking at it, it's much more sane.
https:/
charmworld/
API3Mixin):
On 2013/11/05 12:55:46, benji wrote:
> On 2013/11/04 21:46:34, rharding wrote:
> > remove the stupid Z. Just skipping the bad test for now. See later
files.
> I like the explicitness of the new approach better.
Thanks, removed the comments above as well. Missed that :/
- 444. By Richard Harding
-
Updates per review
- 445. By Richard Harding
-
Fix the test for the basket/bundle order
Juju Gui Bot (juju-gui-bot) : | # |
Preview Diff
1 | === modified file 'charmworld/routes.py' | |||
2 | --- charmworld/routes.py 2013-10-29 19:59:01 +0000 | |||
3 | +++ charmworld/routes.py 2013-11-05 15:01:02 +0000 | |||
4 | @@ -54,13 +54,13 @@ | |||
5 | 54 | 54 | ||
6 | 55 | # Personal Bundles | 55 | # Personal Bundles |
7 | 56 | config.add_route("personal-bundle-json-revision", | 56 | config.add_route("personal-bundle-json-revision", |
9 | 57 | "/~{owner}/bundle/{basket}/{rev}/{bundle}/json") | 57 | "/bundle/~{owner}/{basket}/{rev}/{bundle}/json") |
10 | 58 | config.add_route("personal-bundle-json", | 58 | config.add_route("personal-bundle-json", |
12 | 59 | "/~{owner}/bundle/{basket}/{bundle}/json") | 59 | "/bundle/~{owner}/{basket}/{bundle}/json") |
13 | 60 | config.add_route("personal-bundle-revision", | 60 | config.add_route("personal-bundle-revision", |
15 | 61 | "/~{owner}/bundle/{basket}/{rev}/{bundle}") | 61 | "/bundle/~{owner}/{basket}/{rev}/{bundle}") |
16 | 62 | config.add_route("personal-bundle", | 62 | config.add_route("personal-bundle", |
18 | 63 | "/~{owner}/bundle/{basket}/{bundle}") | 63 | "/bundle/~{owner}/{basket}/{bundle}") |
19 | 64 | 64 | ||
20 | 65 | # Official (promulgated) Bundles | 65 | # Official (promulgated) Bundles |
21 | 66 | config.add_route("official-bundle-json", | 66 | config.add_route("official-bundle-json", |
22 | 67 | 67 | ||
23 | === modified file 'charmworld/views/api/__init__.py' | |||
24 | --- charmworld/views/api/__init__.py 2013-10-24 22:04:01 +0000 | |||
25 | +++ charmworld/views/api/__init__.py 2013-11-05 15:01:02 +0000 | |||
26 | @@ -156,10 +156,10 @@ | |||
27 | 156 | } | 156 | } |
28 | 157 | 157 | ||
29 | 158 | @classmethod | 158 | @classmethod |
31 | 159 | def _bundle_result(cls, bundle, db): | 159 | def _bundle_result(cls, bundle, db, route_url): |
32 | 160 | """Build standard metadata around a bundle search result.""" | 160 | """Build standard metadata around a bundle search result.""" |
33 | 161 | bundle_obj = Bundle(bundle) | 161 | bundle_obj = Bundle(bundle) |
35 | 162 | bundle_metadata = cls._build_bundle_metadata(bundle_obj, db) | 162 | bundle_metadata = cls._build_bundle_metadata(bundle_obj, db, route_url) |
36 | 163 | return { | 163 | return { |
37 | 164 | 'bundle': bundle_metadata, | 164 | 'bundle': bundle_metadata, |
38 | 165 | 'metadata': { | 165 | 'metadata': { |
39 | @@ -414,11 +414,18 @@ | |||
40 | 414 | return charm_id, trailing, charm | 414 | return charm_id, trailing, charm |
41 | 415 | 415 | ||
42 | 416 | @classmethod | 416 | @classmethod |
44 | 417 | def _build_bundle_metadata(cls, bundle, db): | 417 | def _build_bundle_metadata(cls, bundle, db, route_url): |
45 | 418 | bundle_dict = dict(bundle) | 418 | bundle_dict = dict(bundle) |
46 | 419 | # Add the list of files in the bundle. | 419 | # Add the list of files in the bundle. |
47 | 420 | bundle_dict['files'] = bundle.get_file_list(db) | 420 | bundle_dict['files'] = bundle.get_file_list(db) |
48 | 421 | bundle_dict['charm_metadata'] = {} | 421 | bundle_dict['charm_metadata'] = {} |
49 | 422 | bundle_dict['deployer_file_url'] = route_url( | ||
50 | 423 | 'personal-bundle-json-revision', | ||
51 | 424 | basket=bundle_dict['basket_name'], | ||
52 | 425 | bundle=bundle_dict['name'], | ||
53 | 426 | owner=bundle_dict['owner'], | ||
54 | 427 | rev=bundle_dict['basket_revision'], | ||
55 | 428 | ) | ||
56 | 422 | service_data = bundle_dict.get('data') | 429 | service_data = bundle_dict.get('data') |
57 | 423 | # Now load the charm information we require for the services in the | 430 | # Now load the charm information we require for the services in the |
58 | 424 | # bundle. | 431 | # bundle. |
59 | @@ -515,7 +522,8 @@ | |||
60 | 515 | result = {'type': 'no_such_bundle', 'bundle_id': '/'.join(path)} | 522 | result = {'type': 'no_such_bundle', 'bundle_id': '/'.join(path)} |
61 | 516 | return json_response(status, result) | 523 | return json_response(status, result) |
62 | 517 | if not trailing: | 524 | if not trailing: |
64 | 518 | bundle = self._build_bundle_metadata(bundle, self.request.db) | 525 | bundle = self._build_bundle_metadata( |
65 | 526 | bundle, self.request.db, self.request.route_url) | ||
66 | 519 | return json_response(200, bundle) | 527 | return json_response(200, bundle) |
67 | 520 | elif trailing and '/'.join(trailing) == self.ICON_TRAILING: | 528 | elif trailing and '/'.join(trailing) == self.ICON_TRAILING: |
68 | 521 | return self._bundle_icon(bundle) | 529 | return self._bundle_icon(bundle) |
69 | @@ -697,7 +705,8 @@ | |||
70 | 697 | if item['doctype'] == BUNDLE: | 705 | if item['doctype'] == BUNDLE: |
71 | 698 | result = self._bundle_result( | 706 | result = self._bundle_result( |
72 | 699 | Bundle(item['data'])._representation, | 707 | Bundle(item['data'])._representation, |
74 | 700 | self.request.db) | 708 | self.request.db, |
75 | 709 | self.request.route_url) | ||
76 | 701 | else: | 710 | else: |
77 | 702 | result = self._charm_result(Charm(item['data'])) | 711 | result = self._charm_result(Charm(item['data'])) |
78 | 703 | results.append(result) | 712 | results.append(result) |
79 | 704 | 713 | ||
80 | === modified file 'charmworld/views/tests/test_api.py' | |||
81 | --- charmworld/views/tests/test_api.py 2013-10-25 01:16:39 +0000 | |||
82 | +++ charmworld/views/tests/test_api.py 2013-11-05 15:01:02 +0000 | |||
83 | @@ -1,5 +1,7 @@ | |||
86 | 1 | # Copyright 2012, 2013 Canonical Ltd. This software is licensed under the | 1 | # Copyright 2012, 2013 Canonical |
87 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | 2 | |
88 | 3 | # Ltd. This software is licensed under the GNU Affero General Public License | ||
89 | 4 | # version 3 (see the file LICENSE). | ||
90 | 3 | 5 | ||
91 | 4 | __metaclass__ = type | 6 | __metaclass__ = type |
92 | 5 | 7 | ||
93 | @@ -764,6 +766,7 @@ | |||
94 | 764 | self.get_response('bundle', remainder=None) | 766 | self.get_response('bundle', remainder=None) |
95 | 765 | 767 | ||
96 | 766 | def test_valid_lookup_unpromulgated(self): | 768 | def test_valid_lookup_unpromulgated(self): |
97 | 769 | self.enable_routes() | ||
98 | 767 | self.makeBundle(name='bat', owner='bac', basket_with_rev='byobu/4') | 770 | self.makeBundle(name='bat', owner='bac', basket_with_rev='byobu/4') |
99 | 768 | response = self.get_response('bundle', '~bac/byobu/4/bat') | 771 | response = self.get_response('bundle', '~bac/byobu/4/bat') |
100 | 769 | self.assertEqual(200, response.status_code) | 772 | self.assertEqual(200, response.status_code) |
101 | @@ -773,6 +776,7 @@ | |||
102 | 773 | self.assertEqual(404, response.status_code) | 776 | self.assertEqual(404, response.status_code) |
103 | 774 | 777 | ||
104 | 775 | def test_valid_lookup_promulgated(self): | 778 | def test_valid_lookup_promulgated(self): |
105 | 779 | self.enable_routes() | ||
106 | 776 | self.makeBundle( | 780 | self.makeBundle( |
107 | 777 | name='bat', owner='bac', basket_with_rev='byobu/4', | 781 | name='bat', owner='bac', basket_with_rev='byobu/4', |
108 | 778 | promulgated=True) | 782 | promulgated=True) |
109 | @@ -785,6 +789,7 @@ | |||
110 | 785 | self.assertEqual(200, response.status_code) | 789 | self.assertEqual(200, response.status_code) |
111 | 786 | 790 | ||
112 | 787 | def test_results_match(self): | 791 | def test_results_match(self): |
113 | 792 | self.enable_routes() | ||
114 | 788 | # Make the charm that we'll use as a service. | 793 | # Make the charm that we'll use as a service. |
115 | 789 | _id, charm = factory.makeCharm( | 794 | _id, charm = factory.makeCharm( |
116 | 790 | self.db, | 795 | self.db, |
117 | @@ -801,6 +806,7 @@ | |||
118 | 801 | basket_with_rev='byobu/4', services=services) | 806 | basket_with_rev='byobu/4', services=services) |
119 | 802 | response = self.get_response('bundle', '~bac/byobu/4/bat') | 807 | response = self.get_response('bundle', '~bac/byobu/4/bat') |
120 | 803 | self.assertEqual(200, response.status_code) | 808 | self.assertEqual(200, response.status_code) |
121 | 809 | deployer_url = u'http://example.com/bundle/%7Ebac/byobu/4/bat/json' | ||
122 | 804 | self.assertEqual( | 810 | self.assertEqual( |
123 | 805 | response.json, | 811 | response.json, |
124 | 806 | { | 812 | { |
125 | @@ -832,6 +838,7 @@ | |||
126 | 832 | u'permanent_url': u'bundle:~bac/byobu/4/bat', | 838 | u'permanent_url': u'bundle:~bac/byobu/4/bat', |
127 | 833 | u'promulgated': False, | 839 | u'promulgated': False, |
128 | 834 | u'title': u'', | 840 | u'title': u'', |
129 | 841 | u'deployer_file_url': deployer_url, | ||
130 | 835 | }) | 842 | }) |
131 | 836 | 843 | ||
132 | 837 | def test_extracting_bundle_id_with_trailing_full_id(self): | 844 | def test_extracting_bundle_id_with_trailing_full_id(self): |
133 | @@ -1572,10 +1579,7 @@ | |||
134 | 1572 | return names | 1579 | return names |
135 | 1573 | 1580 | ||
136 | 1574 | 1581 | ||
141 | 1575 | # XXX: Rick Harding 2013-10-21: | 1582 | class TestAPI3(TestAPI, API3Mixin): |
138 | 1576 | # Odd bug requires these tests to be run last, hence the Z in the name to | ||
139 | 1577 | # force it to be last. | ||
140 | 1578 | class TestZAPI3(TestAPI, API3Mixin): | ||
142 | 1579 | """Test API 3.""" | 1583 | """Test API 3.""" |
143 | 1580 | 1584 | ||
144 | 1581 | def test_charms_path_notfound(self): | 1585 | def test_charms_path_notfound(self): |
145 | @@ -1587,6 +1591,7 @@ | |||
146 | 1587 | 1591 | ||
147 | 1588 | def test_search_results_contain_charms_and_bundles(self): | 1592 | def test_search_results_contain_charms_and_bundles(self): |
148 | 1589 | self.use_index_client() | 1593 | self.use_index_client() |
149 | 1594 | self.enable_routes() | ||
150 | 1590 | bundle = self.make_indexed_bundle(name='fan-stack-tic') | 1595 | bundle = self.make_indexed_bundle(name='fan-stack-tic') |
151 | 1591 | charm = self.make_indexed_charm() | 1596 | charm = self.make_indexed_charm() |
152 | 1592 | result = self.get_response(self.search_endpoint).json_body['result'] | 1597 | result = self.get_response(self.search_endpoint).json_body['result'] |
153 | @@ -1605,6 +1610,7 @@ | |||
154 | 1605 | 1610 | ||
155 | 1606 | def test_search_result_bundles_includes_metadata(self): | 1611 | def test_search_result_bundles_includes_metadata(self): |
156 | 1607 | self.use_index_client() | 1612 | self.use_index_client() |
157 | 1613 | self.enable_routes() | ||
158 | 1608 | _id, charm = factory.makeCharm(self.db, promulgated=True) | 1614 | _id, charm = factory.makeCharm(self.db, promulgated=True) |
159 | 1609 | services = { | 1615 | services = { |
160 | 1610 | u'charm': { | 1616 | u'charm': { |
161 | @@ -1691,6 +1697,7 @@ | |||
162 | 1691 | 1697 | ||
163 | 1692 | def test_search_interesting_contains_charms_and_bundles(self): | 1698 | def test_search_interesting_contains_charms_and_bundles(self): |
164 | 1693 | self.use_index_client() | 1699 | self.use_index_client() |
165 | 1700 | self.enable_routes() | ||
166 | 1694 | bundle = self.make_indexed_bundle(name='bat') | 1701 | bundle = self.make_indexed_bundle(name='bat') |
167 | 1695 | FeaturedSource.from_db(self.db).set_featured( | 1702 | FeaturedSource.from_db(self.db).set_featured( |
168 | 1696 | bundle._representation, BUNDLE) | 1703 | bundle._representation, BUNDLE) |
169 | @@ -1705,10 +1712,7 @@ | |||
170 | 1705 | self.assertItemsEqual(expected, list_names(result['featured'])) | 1712 | self.assertItemsEqual(expected, list_names(result['featured'])) |
171 | 1706 | 1713 | ||
172 | 1707 | 1714 | ||
177 | 1708 | # XXX: Rick Harding 2013-10-21: | 1715 | class TestAPI2(TestAPI, API2Mixin): |
174 | 1709 | # Odd bug requires these tests to be run last, hence the Z in the name to | ||
175 | 1710 | # force it to be last. | ||
176 | 1711 | class TestZAPI2(TestAPI, API2Mixin): | ||
178 | 1712 | """Test API 2.""" | 1716 | """Test API 2.""" |
179 | 1713 | 1717 | ||
180 | 1714 | def test_charms_passes_doctype(self): | 1718 | def test_charms_passes_doctype(self): |
181 | 1715 | 1719 | ||
182 | === modified file 'charmworld/views/tests/test_bundles.py' | |||
183 | --- charmworld/views/tests/test_bundles.py 2013-10-29 20:38:42 +0000 | |||
184 | +++ charmworld/views/tests/test_bundles.py 2013-11-05 15:01:02 +0000 | |||
185 | @@ -287,7 +287,7 @@ | |||
186 | 287 | basket_with_rev=basket_with_rev, series='raring', | 287 | basket_with_rev=basket_with_rev, series='raring', |
187 | 288 | ) | 288 | ) |
188 | 289 | # Test that the route works. | 289 | # Test that the route works. |
190 | 290 | path = '/~{owner}/bundle/{basket}/{bundle}'.format( | 290 | path = '/bundle/~{owner}/{basket}/{bundle}'.format( |
191 | 291 | owner=owner, basket=basket, bundle=bundle_name) | 291 | owner=owner, basket=basket, bundle=bundle_name) |
192 | 292 | resp = self.app.get(path, status=200) | 292 | resp = self.app.get(path, status=200) |
193 | 293 | self.assertIn(bundle.owner, resp.body) | 293 | self.assertIn(bundle.owner, resp.body) |
194 | @@ -308,7 +308,7 @@ | |||
195 | 308 | self.db, name='gigis', owner='ladonna', | 308 | self.db, name='gigis', owner='ladonna', |
196 | 309 | basket_with_rev='basket/1', series='raring', | 309 | basket_with_rev='basket/1', series='raring', |
197 | 310 | ) | 310 | ) |
199 | 311 | path = '/~ladonna/bundle/basket/1/gigis' | 311 | path = '/bundle/~ladonna/basket/1/gigis' |
200 | 312 | response = self.app.get(path, status=200) | 312 | response = self.app.get(path, status=200) |
201 | 313 | self.assertIn( | 313 | self.assertIn( |
202 | 314 | 'lp:~ladonna/charms/bundles/basket/bundle', response.body) | 314 | 'lp:~ladonna/charms/bundles/basket/bundle', response.body) |
203 | @@ -318,7 +318,7 @@ | |||
204 | 318 | self.db, name='gigis', owner='ladonna', | 318 | self.db, name='gigis', owner='ladonna', |
205 | 319 | basket_with_rev='basket/1', series='raring', | 319 | basket_with_rev='basket/1', series='raring', |
206 | 320 | ) | 320 | ) |
208 | 321 | path = '/~ladonna/bundle/basket/1/XXX' | 321 | path = '/bundle/~ladonna/basket/1/XXX' |
209 | 322 | self.app.get(path, status=404) | 322 | self.app.get(path, status=404) |
210 | 323 | 323 | ||
211 | 324 | def test_personal_bundle_with_revision_json_route(self): | 324 | def test_personal_bundle_with_revision_json_route(self): |
212 | @@ -328,7 +328,7 @@ | |||
213 | 328 | self.db, name='gigis', owner='ladonna', | 328 | self.db, name='gigis', owner='ladonna', |
214 | 329 | basket_with_rev='basket/1', series='raring', | 329 | basket_with_rev='basket/1', series='raring', |
215 | 330 | ) | 330 | ) |
217 | 331 | path = '/~ladonna/bundle/basket/1/gigis/json' | 331 | path = '/bundle/~ladonna/basket/1/gigis/json' |
218 | 332 | resp = self.app.get(path, status=200) | 332 | resp = self.app.get(path, status=200) |
219 | 333 | self.assertIn(bundle.data['series'], resp.body) | 333 | self.assertIn(bundle.data['series'], resp.body) |
220 | 334 | self.assertIn(str(bundle.data['relations']), resp.body) | 334 | self.assertIn(str(bundle.data['relations']), resp.body) |
221 | @@ -341,7 +341,7 @@ | |||
222 | 341 | self.db, name='gigis', owner='lafawnda', | 341 | self.db, name='gigis', owner='lafawnda', |
223 | 342 | basket_with_rev='basket/1', series='raring', | 342 | basket_with_rev='basket/1', series='raring', |
224 | 343 | ) | 343 | ) |
226 | 344 | path = '/~lafawnda/bundle/basket/gigis/json' | 344 | path = '/bundle/~lafawnda/basket/gigis/json' |
227 | 345 | resp = self.app.get(path, status=200) | 345 | resp = self.app.get(path, status=200) |
228 | 346 | self.assertIn(bundle.data['series'], resp.body) | 346 | self.assertIn(bundle.data['series'], resp.body) |
229 | 347 | self.assertIn(str(bundle.data['relations']), resp.body) | 347 | self.assertIn(str(bundle.data['relations']), resp.body) |
230 | @@ -352,7 +352,7 @@ | |||
231 | 352 | self.db, name='gigis', owner='ladonna', | 352 | self.db, name='gigis', owner='ladonna', |
232 | 353 | basket_with_rev='basket/1', series='raring', | 353 | basket_with_rev='basket/1', series='raring', |
233 | 354 | ) | 354 | ) |
235 | 355 | path = '/~ladonna/bundle/basket/1/XXX/json' | 355 | path = '/bundle/~ladonna/basket/1/XXX/json' |
236 | 356 | self.app.get(path, status=404) | 356 | self.app.get(path, status=404) |
237 | 357 | 357 | ||
238 | 358 | def test_official_bundle_route(self): | 358 | def test_official_bundle_route(self): |
239 | 359 | 359 | ||
240 | === modified file 'charmworld/views/tests/test_misc.py' | |||
241 | --- charmworld/views/tests/test_misc.py 2013-10-30 13:20:01 +0000 | |||
242 | +++ charmworld/views/tests/test_misc.py 2013-11-05 15:01:02 +0000 | |||
243 | @@ -46,6 +46,12 @@ | |||
244 | 46 | 46 | ||
245 | 47 | def test_homeview(self): | 47 | def test_homeview(self): |
246 | 48 | """Make sure the home view renders correctly.""" | 48 | """Make sure the home view renders correctly.""" |
247 | 49 | # XXX: #1237025 Rick Harding 2013-10-21: | ||
248 | 50 | # Unknown bug causes this test to fail if other tests enable the | ||
249 | 51 | # self.enable_routes(). Skipping this test and leaving the others. | ||
250 | 52 | # Leaving the bug as a reference to fix this failure. Passes when run | ||
251 | 53 | # in single suite, but fails in global `make test`. | ||
252 | 54 | self.skipTest("See bug #1237025") | ||
253 | 49 | resp = self.app.get( | 55 | resp = self.app.get( |
254 | 50 | '/', | 56 | '/', |
255 | 51 | status=200) | 57 | status=200) |
Reviewers: mp+193851_ code.launchpad. net,
Message:
Please take a look.
Description:
Update bundle user url to be /bundle/$id-bits.
- Update the api to provide that url as part of the bundle metadata so
the gui
can link to it as a valid quickstart end point.
- Drive by to skip the test that fails with the known bug issue.
- Rename the TestApi2 and 3 back to not have the Z since we're just
skipping
vs working around the issue.
https:/ /code.launchpad .net/~rharding/ charmworld/ move-bundle- url/+merge/ 193851
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/21370044/
Affected files (+43, -21 lines): routes. py views/api/ __init_ _.py views/bundles. py views/tests/ test_api. py views/tests/ test_bundles. py views/tests/ test_misc. py
A [revision details]
M charmworld/
M charmworld/
M charmworld/
M charmworld/
M charmworld/
M charmworld/
Index: [revision details] 20131104185142- yu1k77h95eemcw1 g
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: tarmac-
+New revision: <email address hidden>
Index: charmworld/ routes. py routes. py' routes. py 2013-10-29 19:59:01 +0000 routes. py 2013-11-04 20:52:52 +0000
=== modified file 'charmworld/
--- charmworld/
+++ charmworld/
@@ -54,13 +54,13 @@
# Personal Bundles add_route( "personal- bundle- json-revision" , /bundle/ {basket} /{rev}/ {bundle} /json") ~{owner} /{basket} /{rev}/ {bundle} /json") add_route( "personal- bundle- json", /bundle/ {basket} /{bundle} /json") ~{owner} /{basket} /{bundle} /json") add_route( "personal- bundle- revision" , /bundle/ {basket} /{rev}/ {bundle} ") ~{owner} /{basket} /{rev}/ {bundle} ") add_route( "personal- bundle" , /bundle/ {basket} /{bundle} ") ~{owner} /{basket} /{bundle} ")
config.
- "/~{owner}
+ "/bundle/
config.
- "/~{owner}
+ "/bundle/
config.
- "/~{owner}
+ "/bundle/
config.
- "/~{owner}
+ "/bundle/
# Official (promulgated) Bundles add_route( "official- bundle- json",
config.
Index: charmworld/ views/bundles. py views/bundles. py' views/bundles. py 2013-10-29 19:59:01 +0000 views/bundles. py 2013-11-04 20:52:52 +0000 service_ keys:
d[key] = v.get(key, u'')
=== modified file 'charmworld/
--- charmworld/
+++ charmworld/
@@ -40,7 +40,7 @@
for k, v in services.items():
d = dict(name=k)
for key in BundleDetail.
- if key != 'options':
+ if key != 'option':
# Flatten options.
Index: charmworld/ views/api/ __init_ _.py views/api/ __init_ _.py' views/api/ __init_ _.py 2013-10-24 22:04:01 +0000 views/api/ __init_ _.py 2013-11-04 20:52:52 +0000
=== modified file 'charmworld/
--- charmworld/
+++ charmworld/
@@ -156,10 +156,10 @@
}
@classmethod
bundle_ obj = Bun...
- def _bundle_result(cls, bundle, db):
+ def _bundle_result(cls, bundle, db, route_url):
"""Build standard metadata around a bundle search result."""