def test_with_link(self, artifact, links):
    unlinked_bytecode = artifact['bin']
    get_link_address = self.get_links_address(links)
    linked_bytecode = link_code(unlinked_bytecode, get_link_address)
    try:
        contract_factory = self.web3.eth.contract(abi=artifact['abi'], bytecode=linked_bytecode)
    except ValueError as valueError:
        value_error = str(valueError.args.__getitem__(0))
        if (("'" in value_error) and (not self.more)):
            error = str(value_error).split("'")
            console_log(str(error[0]), 'error', 'ValueError')
        elif (("'" in value_error) and self.more):
            console_log(str(value_error), 'error', 'ValueError')
        elif (not self.more):
            console_log(str(value_error).strip('\n')[0], 'error', 'ValueError')
        elif self.more:
            console_log(str(value_error), 'error', 'ValueError')
        sys.exit()
    tx_hash = contract_factory.constructor().transact()
    address = self.web3.eth.getTransactionReceipt(tx_hash)['contractAddress']
    contract = {'abi': artifact['abi'], 'bytecode': linked_bytecode}
    contract_name_and_address = ((artifact['contractName'] + ':') + str(address))
    self.contracts.setdefault(contract_name_and_address, contract)
def test_with_link(self, artifact, links):
    unlinked_bytecode = artifact['bin']
    get_link_address = self.get_links_address(links)
    linked_bytecode = link_code(unlinked_bytecode, get_link_address)
    try:
        contract_factory = self.web3.eth.contract(abi=artifact['abi'], bytecode=linked_bytecode)
    except ValueError as valueError:
        value_error = str(valueError.args.__getitem__(0))
        if (("'" in value_error) and (not self.more)):
            error = str(value_error).split("'")
            console_log(str(error[0]), 'error', 'ValueError')
        elif (("'" in value_error) and self.more):
            console_log(str(value_error), 'error', 'ValueError')
        elif (not self.more):
            console_log(str(value_error).strip('\n')[0], 'error', 'ValueError')
        elif self.more:
            console_log(str(value_error), 'error', 'ValueError')
        sys.exit()
    tx_hash = contract_factory.constructor().transact()
    address = self.web3.eth.getTransactionReceipt(tx_hash)['contractAddress']
    contract = {'abi': artifact['abi'], 'bytecode': linked_bytecode}
    contract_name_and_address = ((artifact['contractName'] + ':') + str(address))
    self.contracts.setdefault(contract_name_and_address, contract)