MCPcopy Create free account
hub / github.com/MG-RAST/Shock / test_upload_emptyfile

Function test_upload_emptyfile

test/test_shock.py:104–118  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

102
103
104def test_upload_emptyfile():
105 TESTURL = "{SHOCK_URL}/node".format(SHOCK_URL=SHOCK_URL)
106 TESTHEADERS = {"Authorization": "OAuth {}".format(TOKEN)}
107 FILES = {'upload': open(DATADIR + 'emptyfile', 'rb')}
108 if DEBUG:
109 print(TESTURL, TESTHEADERS)
110 response = requests.post(TESTURL, headers=TESTHEADERS, files=FILES)
111 data = json.loads(response.content.decode("utf-8"))
112 print(response.content.decode("utf-8"))
113 assert data["status"] == 200
114 assert data["data"]["file"]["checksum"]["md5"] == "d41d8cd98f00b204e9800998ecf8427e"
115 # cleanup
116 NODEID = data["data"]["id"]
117 NODEURL = SHOCK_URL + "/node/{}".format(NODEID)
118 response = requests.delete(NODEURL, headers=TESTHEADERS)
119
120
121def test_upload_threefiles():

Callers

nothing calls this directly

Calls 1

deleteMethod · 0.80

Tested by

no test coverage detected