def step_impl(context, sender, message, destination): """ :param destination: :param message: :param sender: :type context: behave.runner.Context """ Client.send_private_to(sender, message, destination)
def step_impl(context, getter_node, filename, source_node): file = context.files[filename] if Client(getter_node).download_file(file.file_name, file.metahash, source_node) != 0: raise EnvironmentError( "The client failed to ask {} to download the file {} from {}", getter_node, filename, source_node)
def step_impl(context, receiptient, sender, s): count = 0 Client(sender).send("init") while not context.nodes[receiptient].search_output( "RUMOR origin " + sender) and count / 10 < int(s): time.sleep(0.1) count += 1
def step_impl(context, node_name, filename): file = context.files[filename] if Client(node_name).share_file(file.file_name) != 0: raise EnvironmentError( "The client failed to ask {} to share the file {}".format( node_name, filename))
def step_impl(context, name, keywords): assert Client(name).search(keywords) == 0
def step_impl(context, size): for gossiper in context.nodes: Client.send_to(gossiper, random_string(int(size)))
def step_impl(context, name, message): Client.send_to(name, message)