~thekorn/wadllib/fix-340935-use-actual-type

« back to all changes in this revision

Viewing changes to wadllib/docs/wadllib.txt

  • Committer: Launchpad Patch Queue Manager
  • Date: 2008-08-08 19:07:56 UTC
  • mfrom: (3.2.4 introspection)
  • Revision ID: launchpad@pqm.canonical.com-20080808190756-6z0ctdtbfxr0ky5l
[r=celso,allenap] Add the ability to introspect on attribute names.

Show diffs side-by-side

added added

removed removed

Lines of Context:
107
107
test data.
108
108
 
109
109
   >>> bound_service_root = bind_to_testdata(service_root, 'root')
 
110
   >>> bound_service_root.parameter_names
 
111
   ['people_collection_link', 'bugs_collection_link']
 
112
   >>> [method.id for method in bound_service_root.method_iter]
 
113
   ['service-root-get']
 
114
 
110
115
 
111
116
Now the bound resource object has a JSON representation, and now
112
117
'people_collection_link' makes sense. We can follow the
247
252
   >>> from wadllib.application import Resource
248
253
   >>> limi_person = Resource(wadl, "http://api.launchpad.dev/beta/~limi",
249
254
   ...     "http://api.launchpad.dev/beta/#person")
 
255
   >>> sorted([method.id for method in limi_person.method_iter])[:3]
 
256
   ['person-acceptInvitationToBeMemberOf', 'person-addMember', 'person-declineInvitationToBeMemberOf']
250
257
 
251
258
   >>> bound_limi = bind_to_testdata(limi_person, 'person-limi')
 
259
   >>> sorted(bound_limi.parameter_names)[:3]
 
260
   ['admins_collection_link', 'confirmed_email_addresses_collection_link', 'date_created']
252
261
   >>> languages_link = bound_limi.get_parameter("languages_collection_link")
253
262
   >>> languages_link.get_value()
254
263
   u'http://api.launchpad.dev/beta/~limi/languages'