Beispiel #1
0
def test_bad_bin_set():
    bad_file_path = os.path.realpath(f"{TEMP_DIR}/test_bad_bin_set/hmy")
    shutil.rmtree(Path(bad_file_path).parent, ignore_errors=True)
    os.makedirs(Path(bad_file_path).parent, exist_ok=True)
    Path(bad_file_path).touch()
    is_set = cli.set_binary(bad_file_path)
    assert not is_set
    assert cli.get_binary_path() != bad_file_path
Beispiel #2
0
import sys
sys.path.append("../")
from pyhmy import cli
import os

#set up binnary path
env = cli.download("./bin/test", replace=False)
cli.environment.update(env)
new_path = os.getcwd() + "/bin/test"
cli.set_binary(new_path)
print("The binary path is %s"%(cli.get_binary_path()))

#get a dict of account names
name_dict = cli.get_accounts_keystore()
print(name_dict)

#get keystore path
print("Your accounts are store in %s"%(cli.get_account_keystore_path()))

if "difeng" not in name_dict.keys():
    #create a user
    cli.single_call("hmy keys add difeng")
    print("difeng has been successfully created")

if "dfxx" not in name_dict.keys():
    #create a user
    cli.single_call("hmy keys add dfxx")
    print("dfxx has been successfully created")

if "test1" not in name_dict.keys():
    #create a user
Beispiel #3
0
def test_bin_set():
    cli.set_binary(BINARY_FILE_PATH)
    cli_binary_path = cli.get_binary_path()
    assert os.path.realpath(cli_binary_path) == os.path.realpath(BINARY_FILE_PATH)