Skip to content

Commit

Permalink
covered submitter
Browse files Browse the repository at this point in the history
  • Loading branch information
Chen2x committed May 19, 2017
1 parent 6390723 commit acc3dd7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 7 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,19 @@ def mock_server(ctx):

#for object_submission/update_obj
httpretty.register_uri(httpretty.GET, "%ssamples/12345?action=EDIT" % (ctx.obj['SETTINGS']['apiUrl']),
body='{"header" : {"code" : "200"}, "response" : {"result" : [{ "id":"12345", "status": ["SUBMITTED_DRAFT"]]}]}}',
body='{"header" : {"code" : "200"}, "response" : {"result" : [{ "id":"12345", "status": ["SUBMITTED_DRAFT"]}]}}',
content_type="application/json")



#for submitter PUT
httpretty.register_uri(httpretty.PUT, "%ssamples/12345?action=EDIT" % (ctx.obj['SETTINGS']['apiUrl']),
body='{"header" : {"code" : "200"}, "response" : {"result" : [{ "id":"12345", "alias": "fgfg", "status": ["SUBMITTED_DRAFT"]}]}}',
body='{"header" : {"code" : "200"}, "response" : {"result" : [{ "id":"12345", "alias": "fgfg", "status": "VALIDATED"}]}}',
content_type="application/json")

# for submitter PUT
httpretty.register_uri(httpretty.DELETE, "https://ega.crg.eu/submitterportal/v1/samples/12345",
body='{"header" : {"code" : "200"}, "response" : {"result" : [{ "id":"12345", "alias": "fgfg", "status": "VALIDATED"}]}}',
content_type="application/json")

#httpretty.register_uri(httpretty.GET, 'ftp.ega.ebi.ac.uk')
4 changes: 2 additions & 2 deletions tests/submission/test_submitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ def test_submitter(ctx, mock_server):
ctx.obj['SUBMISSION']['id'] = "55"

#fix the put fixture
with pytest.raises(Exception):
submitter.submit(unaligned2,True)
#with pytest.raises(Exception):
submitter.submit(unaligned2,True)

submitter.submit(unaligned, True)

Expand Down

0 comments on commit acc3dd7

Please sign in to comment.