Exemplo n.º 1
0
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
Exemplo n.º 2
0
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
Exemplo n.º 3
0
def testPutHistoryNoPsk():
    with pytest.raises(ValueError) as ex:
        hist.putHistory(history, sk1, None, urls)
Exemplo n.º 4
0
def testPutHistoryEmptySk():
    with pytest.raises(ValueError) as ex:
        hist.putHistory(history, "", sk2, urls)
Exemplo n.º 5
0
def testPutHistoryEmptyUrls():
    with pytest.raises(ValueError) as ex:
        hist.putHistory(history, sk1, sk2, [])
Exemplo n.º 6
0
def testPutHistoryNoUrls():
    with pytest.raises(ValueError) as ex:
        hist.putHistory(history, sk1, sk2, None)