def testReadWrite(odbhs: OrientDbHashStore, nodesLeaves): nodes, leaves = nodesLeaves for node in nodes: odbhs.writeNode(node) for leaf in leaves: odbhs.writeLeaf(leaf) onebyone = [odbhs.readLeaf(i + 1) for i in range(10)] multiple = odbhs.readLeafs(1, 10) assert onebyone == multiple
def testReadWrite(odbhs: OrientDbHashStore, nodesLeaves): nodes, leaves = nodesLeaves for node in nodes: odbhs.writeNode(node) for leaf in leaves: odbhs.writeLeaf(leaf) onebyone = [odbhs.readLeaf(i + 1) for i in range(10)] multiple = odbhs.readLeafs(1, 10) assert onebyone == leaves assert onebyone == multiple
def testUniqueConstraint(odbhs: OrientDbHashStore): leafHash = generateHashes(1)[0] odbhs.writeLeaf(leafHash) with pytest.raises(pyorient.PyOrientORecordDuplicatedException): odbhs.writeLeaf(leafHash)