def testPutHistory(): history['signer'] = 1 history['signers'].append(vk3) result = hist.putHistory(history, sk1, sk2, urls) assert result[url1 + "/" + history["id"]].status == 200 assert result[url1 + "/" + history["id"]].response.body == history assert result[url2 + "/" + history["id"]].status == 200 assert result[url2 + "/" + history["id"]].response.body == history
def testGetHistoryEvents(): events = {"events": {}} events['events']['0'] = hist.postHistory(history, sk1, urls).popitem()[1].response.data history['signer'] = 1 history['signers'].append(vk3) events['events']['1'] = hist.putHistory(history, sk1, sk2, urls).popitem()[1].response.data data, results = event.getHistoryEvents(did, urls) assert data == events
def testPutHistoryNoPsk(): with pytest.raises(ValueError) as ex: hist.putHistory(history, sk1, None, urls)
def testPutHistoryEmptySk(): with pytest.raises(ValueError) as ex: hist.putHistory(history, "", sk2, urls)
def testPutHistoryEmptyUrls(): with pytest.raises(ValueError) as ex: hist.putHistory(history, sk1, sk2, [])
def testPutHistoryNoUrls(): with pytest.raises(ValueError) as ex: hist.putHistory(history, sk1, sk2, None)