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

Function test_put_attributesstr

test/test_shock.py:438–460  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

436 delete_nodes(NODES)
437
438def test_put_attributesstr():
439 NODE = create_nodes(["AAA.txt"])[0]
440 TESTDATA = {"attributes_str": (None, '{"project_id":"TESTPROJECT2"}')}
441 TESTHEADERS = {"Authorization": "OAuth {}".format(TOKEN)}
442 if DEBUG:
443 print("PUT", SHOCK_URL + "/node/" + NODE, TESTDATA)
444 r = requests.put(SHOCK_URL + "/node/" +
445 NODE, files=TESTDATA, headers=TESTHEADERS)
446 if DEBUG:
447 print(r.content.decode("utf-8"))
448 data = json.loads(r.content.decode("utf-8"))
449 if DEBUG:
450 print(data)
451 assert data["data"]["attributes"]["project_id"] == "TESTPROJECT2"
452 TESTDATA = {"attributes_str": (None, '{"project_id":"TESTPROJECT"}')}
453 if DEBUG:
454 print("PUT", SHOCK_URL + "/node/" + NODE, TESTDATA)
455 r = requests.put(SHOCK_URL + "/node/" +
456 NODE, files=TESTDATA, headers=TESTHEADERS)
457 if DEBUG:
458 print(r.content.decode("utf-8"))
459 data = json.loads(r.content.decode("utf-8"))
460 assert data["data"]["attributes"]["project_id"] == "TESTPROJECT"
461
462
463def test_post_attributes():

Callers

nothing calls this directly

Calls 1

create_nodesFunction · 0.85

Tested by

no test coverage detected