Broadsword -- JSONTest Documentation
Where is JSONTest
JSONest lives in the tools repository under the broadsword project.
svn co svn+ssh://svn.osafoundation.org/svn/tools/broadsword/trunk/modules/JSONTest.py JSONTest.py
What is JSONest
JSONTest is a class providing JSON-RPC specific functionality for our tests.
JSONst inherits from
HTTPTest for all it's test framework needs.
What is defined in JSONTest
Currently there are 3 methods provided in this class.
parseJSON method: Optional string argument, defaults to self.test_response.read(). Returns a python dictionary of the string argument if supplied, else it returns a dictionary of the last request response.
convertToJson method: Takes a python dictionary argument, returns the string representation.
getJsonAttrib method: This method takes a string argument, and returns a string corresponding to string argument passed from the last request response. For example in Scooby testing we need to know the result because it is the JSID used to keep the session going, so we call: JSID = getJsonAttrib('result').