()
| 498 | |
| 499 | |
| 500 | def test_post_bzip(): |
| 501 | TESTURL = "{SHOCK_URL}/node".format(SHOCK_URL=SHOCK_URL) |
| 502 | TESTHEADERS = {"Authorization": "OAuth {}".format(TOKEN)} |
| 503 | # to get multipart-form correctly, data has to be specified in this strange way |
| 504 | # and passed as the files= parameter to requests.put |
| 505 | TESTDATA = {"attributes_str": (None, '{"project_id":"TESTPROJECT"}')} |
| 506 | FILES = {'bzip2': open(DATADIR + "10kb.fna.bz2", 'rb')} |
| 507 | if DEBUG: |
| 508 | print("POST", TESTURL, TESTDATA, TESTHEADERS) |
| 509 | response = requests.post(TESTURL, headers=TESTHEADERS, files=FILES, data=TESTDATA) |
| 510 | data = json.loads(response.content.decode("utf-8")) |
| 511 | assert data["status"] == 200 |
| 512 | NODE = data["data"]["id"] |
| 513 | assert data["data"]["file"]["name"] == "10kb.fna" |
| 514 | assert data["data"]["file"]["checksum"]["md5"] == "730c276ea1510e2b7ef6b682094dd889" |
| 515 | delete_nodes([NODE]) |
nothing calls this directly
no test coverage detected