예제 #1
0
def test_publicly_routable(calculate_mi_vars, routable):
    attrs = {}
    if routable:
        attrs['publicly_routable'] = True

    mirrorer = mirror(('', attrs, []))
    func = calculate_mi_vars(mirrorer)
    _, _, groups = func()
    if routable:
        assert 'publicly_routable' in groups
    else:
        assert 'publicly_routable' not in groups
예제 #2
0
def test_publicly_routable(calculate_mi_vars, routable):
    attrs = {}
    if routable:
        attrs['publicly_routable'] = True

    mirrorer = mirror(('', attrs, []))
    func = calculate_mi_vars(mirrorer)
    _, _, groups = func()
    if routable:
        assert 'publicly_routable' in groups
    else:
        assert 'publicly_routable' not in groups
예제 #3
0
def test_attrs(calculate_mi_vars, role, serverstate):
    mirrorer = mirror(('', {'role': role}, []))
    func = calculate_mi_vars(mirrorer)
    _, attrs, _ = func()
    assert 'consul_is_server' in attrs
    assert attrs['consul_is_server'] == serverstate
예제 #4
0
def test_attrs(calculate_mi_vars, role, serverstate):
    mirrorer = mirror(('', {'role': role}, []))
    func = calculate_mi_vars(mirrorer)
    _, attrs, _ = func()
    assert 'consul_is_server' in attrs
    assert attrs['consul_is_server'] == serverstate