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

Function test_upload_threefiles

test/test_shock.py:121–138  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

119
120
121def test_upload_threefiles():
122 NODES = create_nodes(FILELIST)
123 TESTURL = "{SHOCK_URL}/node/?query".format(SHOCK_URL=SHOCK_URL)
124 if DEBUG:
125 print(TESTURL)
126 TESTDATA = {}
127 TESTHEADERS = {"Authorization": "OAuth {}".format(TOKEN)}
128 response = requests.get(TESTURL, headers=TESTHEADERS, params=TESTDATA)
129 data = json.loads(response.content.decode("utf-8"))
130 assert data["total_count"] >= 3
131 assert NODES[0] in response.content.decode("utf-8")
132 assert b"AAA.txt" in response.content
133 assert b"BBB.txt" in response.content
134 assert b"CCC.txt" in response.content
135 # cleanup
136 for NODEID in NODES:
137 NODEURL = SHOCK_URL + "/node/{}".format(NODEID)
138 response = requests.delete(NODEURL, headers=TESTHEADERS)
139
140
141def test_upload_and_delete_node():

Callers

nothing calls this directly

Calls 3

create_nodesFunction · 0.85
getMethod · 0.80
deleteMethod · 0.80

Tested by

no test coverage detected