Esempio n. 1
0
def test_dht_write_value_multiple_nodes():
    if os.environ.get('RUN_TESTS', '1') == '0':
        return pytest.skip()  # @UndefinedVariable

    for node in [
            'supplier-1',
            'supplier-2',
    ]:
        dht_value_set_v1(
            node=node,
            key='test_key_2_shared',
            new_data=f'test_data_2_shared_%s' % (node.replace('-', '_')),
        )
        time.sleep(2)
    for node in [
            'customer-1',
            'customer-2',
            'customer-3',
    ]:
        dht_value_get_v1(
            node=node,
            key='test_key_2_shared',
            expected_data=[
                'test_data_2_shared_supplier_1',
                'test_data_2_shared_supplier_2',
                'test_data_2_shared_supplier_3'
            ],
        )
Esempio n. 2
0
def test_dht_set_value_customer_2_and_get_value_customer_3():
    if os.environ.get('RUN_TESTS', '1') == '0':
        return pytest.skip()  # @UndefinedVariable

    dht_value_set_v1(
        node='customer-2',
        key='test_key_1_customer_2',
        new_data='test_data_1_customer_2',
    )
    dht_value_get_v1(
        node='customer-3',
        key='test_key_1_customer_2',
        expected_data=[
            'test_data_1_customer_2',
        ],
    )
Esempio n. 3
0
def test_dht_get_value_multiple_nodes():
    if os.environ.get('RUN_TESTS', '1') == '0':
        return pytest.skip()  # @UndefinedVariable

    dht_value_set_v1(
        node='supplier-1',
        key='test_key_1_supplier_1',
        new_data='test_data_1_supplier_1',
    )
    time.sleep(2)
    for node in [
            'customer-1',
            'customer-2',
            'customer-3',
    ]:
        dht_value_get_v1(
            node=node,
            key='test_key_1_supplier_1',
            expected_data=[
                'test_data_1_supplier_1',
            ],
        )