예제 #1
0
 def TestUsageExamples(self):
     """
     Rather un-exciting test but at least the code is exercised and expected
     behaviour checked.
     """
     u = HTTPUsage('/dummy', 'an example of great profundity')
     request = 'foo'
     response = 'bar'
     description = 'baz'
     example = HTTPExample(request, response, description)
     u.addExample(example)
     self.assertEqual(1, len(u.examples))
     self.assertEqual('foo', u.examples[0].request)
     self.assertEqual('bar', u.examples[0].response)
     self.assertEqual('baz', u.examples[0].description)
예제 #2
0
파일: values.py 프로젝트: xanixon/fluiddb
                    "value" : "http://bit.ly/4bYAV2",
                    "updated-at" : "2012-02-13T18:15:24.571150"
                }
            }
        }
    }
}
''' % resultsKey

description = '''
Search for objects in Fluidinfo matching mike/rating > 5 and retrieve values
for the tags <span class="tag">ntoll/rating</span>,
<span class="tag">ntoll/resume</span>, <span class="tag">fluiddb/about</span>,
and <span class="tag">bit.ly/url</span> from those objects.'''

usage.addExample(HTTPExample(request, response, description))

# ------------------------------ Values PUT -----------------------------
topLevel = HTTPTopLevel(httpValueCategoryName, 'PUT')

topLevel.description = """The PUT method on values sets tag values
    on objects matching queries.  Unknown namespaces and tags are created
    automatically."""

registry.register(topLevel)

# --- PUT /values -----------------------------------------------------

usage = HTTPUsage(
    '', """Search for objects matching a series of Fluidinfo queries, and set
    the values of the given tags on the matching objects.""")