Fix swapped args in do_raw. Add project_url(). Test fix & RefineProject.export()
This commit is contained in:
parent
e9bc0a2a5a
commit
f863045f01
|
@ -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."""
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue