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 project_dir(tmpdir, monkeypatch): from populus.utils.filesystem import ( ensure_path_exists, get_contracts_dir, get_build_dir, get_blockchains_dir, ) _project_dir = str(tmpdir.mkdir("project-dir")) # setup project directories ensure_path_exists(get_contracts_dir(_project_dir)) ensure_path_exists(get_build_dir(_project_dir)) ensure_path_exists(get_blockchains_dir(_project_dir)) monkeypatch.chdir(_project_dir) monkeypatch.syspath_prepend(_project_dir) return _project_dir
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 build_dir(self): if self.config.has_option('populus', 'build_dir'): return self.config.get('populus', 'build_dir') else: return get_build_dir(self.project_dir)
def build_dir(self): if 'compilation.build_dir' in self.config: return self.config['compilation.build_dir'] else: return get_build_dir(self.project_dir)
def build_dir(self): if self.config.has_option("populus", "build_dir"): return self.config.get("populus", "build_dir") else: return get_build_dir(self.project_dir)