Fix swapped args in do_raw. Add project_url(). Test fix & RefineProject.export()

This commit is contained in:
Paul Makepeace 2011-04-28 18:00:04 +00:00
parent e9bc0a2a5a
commit f863045f01
2 changed files with 12 additions and 2 deletions

View File

@ -224,11 +224,15 @@ class RefineProject:
self.get_models()
def project_name(self):
return Refine(self.server).get_project_name(project_id)
return Refine(self.server).get_project_name(self.project_id)
def project_url(self):
"""Return a URL to the project."""
return '%s/project?project=%s' % (self.server.server, self.project_id)
def do_raw(self, command, data):
"""Issue a command to the server & return a response object."""
return self.server.urlopen(command, self.project_id, data)
return self.server.urlopen(command, data, self.project_id)
def do_json(self, command, data=None, include_engine=True):
"""Issue a command to the server, parse & return decoded JSON."""

View File

@ -48,6 +48,12 @@ class RefineTest(refinetest.RefineTestCase):
def test_delete_project(self):
self.assertTrue(self.project.delete())
def test_open_export(self):
fp = refine.RefineProject(self.project.project_url()).export()
line = fp.next()
self.assertTrue('email' in line)
fp.close()
if __name__ == '__main__':
unittest.main()