Example #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
Example #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
Example #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
Example #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