Beispiel #1
0
    def test_root(self):
        try:
            a = ImmudbClient()
            a.login("immudb", "immudb")
        except grpc._channel._InactiveRpcError as e:
            pytest.skip("Cannot reach immudb server")
        r1 = a.currentRoot()
        key = "test_key_{:04d}".format(randint(0, 10000))
        value = "test_value_{:04d}".format(randint(0, 10000))
        a.safeSet(key.encode('utf8'), value.encode('utf8'))
        r2 = a.currentRoot()

        assert r2.index > r1.index
        a.logout()
        a.shutdown()
Beispiel #2
0
 def test_consistency_verify(self):
     a = ImmudbClient()
     try:
         a = ImmudbClient("localhost:3322")
         a.login("immudb", "immudb")
     except grpc._channel._InactiveRpcError as e:
         pytest.skip("Cannot reach immudb server")
     a.safeSet(b'dummy', b'dummy')
     root = a.currentRoot()
     a.safeSet(b'dummy1', b'dummy1')
     print(root)
     cns = a.stub.Consistency(schema_pb2.Index(index=root.index))
     print(cns)
     ret = verify(cns, root)
     assert ret == True