~barry/ubuntu/natty/lazr.restful/bug-759205

« back to all changes in this revision

Viewing changes to src/lazr/restful/example/multiversion/tests/wadl.txt

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2010-06-28 10:11:11 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100628101111-a00pkffnva3y87q9
Tags: 0.9.29-0ubuntu1
new upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
    ...         api_version=version).body
25
25
    ...     tree = etree.fromstring(wadl)
26
26
    ...
27
 
    ...     keys = ("base service_root service_root_json pair_collection "
28
 
    ...             "pair_entry pair_full_json pair_diff_jaon pair_page "
29
 
    ...             "pair_page_json hosted_file hosted_file_representation"
 
27
    ...     keys = ("service_doc version_doc base service_root "
 
28
    ...             "service_root_json pair_collection pair_entry"
 
29
    ...             "pair_full_json pair_diff_jaon pair_page pair_page_json"
 
30
    ...             "hosted_file hosted_file_representation"
30
31
    ...             ).split()
31
32
    ...
32
33
    ...     tags = [child for child in tree if not isinstance(child, _Comment)]
39
40
is not present at all.
40
41
 
41
42
    >>> contents = wadl_contents_for_version('beta')
 
43
    >>> print contents['version_doc'].attrib['title']
 
44
    About version beta
 
45
 
42
46
    >>> print contents['base'].attrib['base']
43
47
    http://multiversion.dev/beta/
44
48
 
46
50
    >>> sorted([method.attrib['id'] for method in pair_collection])
47
51
    ['key_value_pairs-get']
48
52
 
 
53
As a side note, see that the service documentation and version
 
54
documentation tags are empty, because this service's configuration
 
55
doesn't specify that information:
 
56
 
 
57
    >>> len(list(contents['service_doc']))
 
58
    0
 
59
    >>> len(list(contents['version_doc']))
 
60
    0
 
61
 
49
62
In '2.0', the by_value method is called 'byValue'.
50
63
 
51
64
    >>> contents = wadl_contents_for_version('2.0')
 
65
    >>> print contents['version_doc'].attrib['title']
 
66
    About version 2.0
52
67
    >>> print contents['base'].attrib['base']
53
68
    http://multiversion.dev/2.0/
54
69
 
59
74
In '3.0', the method changes its name to 'by_value'.
60
75
 
61
76
    >>> contents = wadl_contents_for_version('3.0')
 
77
    >>> print contents['version_doc'].attrib['title']
 
78
    About version 3.0
62
79
    >>> print contents['base'].attrib['base']
63
80
    http://multiversion.dev/3.0/
64
81