#test register to server.
print "registering wallet"
print notary_obj.register_user(test_data.email_address)
print "getting register status"
print notary_obj.register_user_status()
#test register to server agin.
print "testing register again"
print notary_obj.register_user(test_data.email_address)
print "getting register status"
print notary_obj.register_user_status()
print (raw_input('Finish confirmation and click'))
print "getting register status"
print notary_obj.register_user_status()
#test to notarize before confirmation/registeration
print "notarizing file"
print notary_obj.notarize_file(test_data.notary_file_name,test_data.getMetaData())
#test document status.
print "notarize again to see behaviour"
print notary_obj.notarize_file(test_data.notary_file_name,test_data.getMetaData())
print "upload file"
print notary_obj.upload_file(test_data.notary_file_name, True)
print "notary_status"
print notary_obj.notary_status(test_data.document_hash)
print "download file"
print notary_obj.download_file(test_data.document_hash,test_data.storing_file_name, True)





import test_data
from notary_client import NotaryClient, NotaryException

try:
    notary_client = NotaryClient('./notaryconfig.ini', 'foobar')
    message = notary_client.notarize_file(test_data.notary_file_name, test_data.getMetaData())
    print(message)
except NotaryException as e:
    print("Code %s " % e.error_code)
    print(e.message)
Beispiel #3
0
    print (e.message)
print (raw_input("Finish confirmation and click"))
try:
    login_result = notary.main_method(["login", "-password", "test123"])
except NotaryException as e:
    print ("Code %s " % e.error_code)
    print (e.message)

if login_result:
    transaction_id = notary.main_method(
        [
            "notarize",
            "-file",
            test_data.notary_file_name,
            "-metadata",
            json.dumps(test_data.getMetaData()),
            "-password",
            "test123",
        ]
    )
    if transaction_id is not None:
        print notary.main_method(["uploadfile", "-file", test_data.notary_file_name, "-password", "test123"])
        print transaction_id
        transaction_status = notary.main_method(
            ["notarystatus", "-document_hash", document_hash, "-password", "test123"]
        )
        print transaction_status

        print notary.main_method(
            [
                "downloadfile",
Beispiel #4
0
    print notary_obj.get_account()
except NotaryException as e:
    print("Code %s " % e.error_code)
    print(e.message)

print (raw_input('Finish confirmation and click'))
print "getting register status"
try:
    print notary_obj.get_account()
except NotaryException as e:
    print("Code %s " % e.error_code)
    print(e.message)
#test to notarize before confirmation/registeration
print "notarizing file"
try:
    print notary_obj.notarize_file(test_data.notary_file_name,test_data.getMetaData())
except NotaryException as e:
    print("Code %s " % e.error_code)
    print(e.message)
#test document status.
print "notarize again to see behaviour"
try:
    print notary_obj.notarize_file(test_data.notary_file_name,test_data.getMetaData())
except NotaryException as e:
    print("Code %s " % e.error_code)
    print(e.message)
print "upload file"
try:
    print notary_obj.upload_file(test_data.notary_file_name)
except NotaryException as e:
    print("Code %s " % e.error_code)
Beispiel #5
0
        "*****@*****.**"
    ])
except NotaryException as e:
    print("Code %s " % e.error_code)
    print(e.message)
print(raw_input('Finish confirmation and click'))
try:
    login_result = notary.main_method(['login', '-password', 'test123'])
except NotaryException as e:
    print("Code %s " % e.error_code)
    print(e.message)

if login_result:
    transaction_id = notary.main_method([
        'notarize', '-file', test_data.notary_file_name, '-metadata',
        json.dumps(test_data.getMetaData()), '-password', 'test123'
    ])
    if transaction_id is not None:
        print notary.main_method([
            'uploadfile', '-file', test_data.notary_file_name, '-password',
            'test123'
        ])
        print transaction_id
        transaction_status = notary.main_method([
            'notarystatus', "-document_hash", document_hash, '-password',
            'test123'
        ])
        print transaction_status

        print notary.main_method([
            'downloadfile', "-document_hash", document_hash, '-file',
#test wallet is registered or not.
#test wallet is confirmed or not.
#test register to server.
print "registering wallet"
print notary_obj.register_user(test_data.email_address)
print "getting register status"
print notary_obj.register_user_status()
#test register to server agin.
print "testing register again"
print notary_obj.register_user(test_data.email_address)
print "getting register status"
print notary_obj.register_user_status()
print(raw_input('Finish confirmation and click'))
print "getting register status"
print notary_obj.register_user_status()
#test to notarize before confirmation/registeration
print "notarizing file"
print notary_obj.notarize_file(test_data.notary_file_name,
                               test_data.getMetaData())
#test document status.
print "notarize again to see behaviour"
print notary_obj.notarize_file(test_data.notary_file_name,
                               test_data.getMetaData())
print "upload file"
print notary_obj.upload_file(test_data.notary_file_name, True)
print "notary_status"
print notary_obj.notary_status(test_data.document_hash)
print "download file"
print notary_obj.download_file(test_data.document_hash,
                               test_data.storing_file_name, True)