示例#1
0
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)
示例#2
0
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)
示例#3
0
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
示例#4
0
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))
示例#5
0
def step_impl(context, name, keywords):
    assert Client(name).search(keywords) == 0
示例#6
0
def step_impl(context, size):
    for gossiper in context.nodes:
        Client.send_to(gossiper, random_string(int(size)))
示例#7
0
def step_impl(context, name, message):
    Client.send_to(name, message)