========================================================================
http://mondrian.corp.google.com/file/8228214///depot/googleclient/gears/opensource/gears/test/testcases/cgi/location_provider.py?a=3
File 
//depot/googleclient/gears/opensource/gears/test/testcases/cgi/location_provider.py
 (snapshot 3)
------------------------------------
Line 3: """ A dummy location provider to be used in the Geolocation API tests.
I've been using the term 'network location provider'.
------------------------------------
Line 10: Currently the following conditions are honored by this scriptlet:
I think we should make clear that we're testing 3 cases
- the server returns a good/valid position fix
- the server couldn't get a good fix
- the request was malformed
We do this by returning a populated location object, a null location object and
a 400 respectively.
------------------------------------
Line 12: a correctly formatted JSON response (GOOD_JSON_RESPONSE below) is 
returned.
Both this response and the following one should be correctly formatted - but
this should be a 'good' fix, while the following is a 'location not found'
response.
------------------------------------
Line 44: def __HasValueInFixRequest(self, expected_value, key_name, 
dictionary_name):
You're looking for a key with name dictionary_name, the value of which you
assume to be a list of dictionaries. Within each of those dictionaries, you look
for a key named 'key_name' and test for 'expected_value'. So I think that
'dictionary_name' should be renamed 'outer_key' and 'key_name' should be renamed
'inner_key', or some more descriptive naming scheme.
------------------------------------
Line 56: dictionary = self.request[dictionary_name]
This is isn't a dictionary. It's a list of dictionaries. Also, can you test to
check this?
------------------------------------
Line 59: value = item.get(key_name, None)
Similarly, you assume that item is a dictionary. Can you test for this?
------------------------------------
Line 143: send_response(self, 500, "Please provide a POST method.")
Shouldn't this be a 4XX code?
========================================================================

-- 
To respond, reply to this email or visit http://mondrian.corp.google.com/8228214

Reply via email to