def test_project_directory_properties(project_dir): project = Project() contracts_dir = get_contracts_dir(project_dir) assert is_same_path(project.contracts_dir, contracts_dir) build_dir = get_build_dir(project_dir) assert is_same_path(project.build_dir, build_dir) compiled_contracts_file_path = get_compiled_contracts_file_path( project_dir) assert is_same_path(project.compiled_contracts_file_path, compiled_contracts_file_path) blockchains_dir = get_blockchains_dir(project_dir) assert is_same_path(project.blockchains_dir, blockchains_dir) data_dir = get_data_dir(project_dir, 'some-test-chain-name') assert is_same_path( project.get_blockchain_data_dir('some-test-chain-name'), data_dir) chaindata_dir = get_chaindata_dir(data_dir) assert is_same_path( project.get_blockchain_chaindata_dir('some-test-chain-name'), chaindata_dir) geth_ipc_path = get_geth_ipc_path(data_dir) assert is_same_path( project.get_blockchain_ipc_path('some-test-chain-name'), geth_ipc_path)
def reset_chain(data_dir): chaindata_dir = get_chaindata_dir(data_dir) remove_dir_if_exists(chaindata_dir) dapp_dir = get_dapp_dir(data_dir) remove_dir_if_exists(dapp_dir) nodekey_path = get_nodekey_path(data_dir) remove_file_if_exists(nodekey_path) geth_ipc_path = get_geth_ipc_path(data_dir) remove_file_if_exists(geth_ipc_path)
def test_project_directory_properties(project_dir): project = Project() contracts_dir = get_contracts_dir(project_dir) assert is_same_path(project.contracts_dir, contracts_dir) build_dir = get_build_dir(project_dir) assert is_same_path(project.build_dir, build_dir) compiled_contracts_file_path = get_compiled_contracts_file_path(project_dir) assert is_same_path(project.compiled_contracts_file_path, compiled_contracts_file_path) blockchains_dir = get_blockchains_dir(project_dir) assert is_same_path(project.blockchains_dir, blockchains_dir) data_dir = get_data_dir(project_dir, "some-test-chain-name") assert is_same_path(project.get_blockchain_data_dir("some-test-chain-name"), data_dir) chaindata_dir = get_chaindata_dir(data_dir) assert is_same_path(project.get_blockchain_chaindata_dir("some-test-chain-name"), chaindata_dir) geth_ipc_path = get_geth_ipc_path(data_dir) assert is_same_path(project.get_blockchain_ipc_path("some-test-chain-name"), geth_ipc_path)
def get_blockchain_chaindata_dir(self, chain_name): return get_chaindata_dir(self.get_blockchain_data_dir(chain_name))