Skip to content

Commit

Permalink
Fixed list-marshalling stuff and can now do assignments and getSource…
Browse files Browse the repository at this point in the history
…s with multiple uuids
  • Loading branch information
quentinsf committed Jan 4, 2011
1 parent 2704256 commit 68dd8c5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions api.py
Expand Up @@ -135,10 +135,10 @@ def callMethod(self, method, **kwargs):
# API Marshalling guide just says that dicts and lists should be in JSON format
for k in kwargs:
v = kwargs[k]
if isinstance(k, dict) or isinstance(k, list):
params[k] = json.dumps(kwargs[k])
if isinstance(v, dict) or isinstance(v, list):
params[k] = json.dumps(v)
else:
params[k] = kwargs[k]
params[k] = v
url, postdata = self.get_url_and_postdata(method, params)
response = urllib2.urlopen(url, postdata)
data = response.read()
Expand Down
6 changes: 3 additions & 3 deletions codatests.py
Expand Up @@ -97,10 +97,10 @@ def testSources(self):
# Search for multiple sources (just one for now!)
# XXX This may not be live on the server yet!
#
#srch_src = self.coda.getSources(source_uuids=[new_source_uuid])
srch_src = self.coda.getSources(source_uuids=[new_source_uuid])
# Check there's only one and it has the right uuid
#self.assertEqual(len(srch_src), 1)
#self.assertEqual(new_source_uuid, srch_src[0]['source_uuid'])
self.assertEqual(len(srch_src), 1)
self.assertEqual(new_source_uuid, srch_src[0]['source_uuid'])

# The delete it and check it's gone
self.coda.removeSource(source_uuid=new_source_uuid)
Expand Down

0 comments on commit 68dd8c5

Please sign in to comment.