Ejemplo n.º 1
0
def test_wrong_inspect_data():

    s = Service()
    s._inspected = True
    s._inspect_data = {'foo': 'bar'}

    assert not s.is_running()
Ejemplo n.º 2
0
def test_no_lazy_inspect_not_inspected(method):

    s = Service(name='foo', client=flexmock())
    s._inspected = False

    with pytest.raises(Service.NotInspectedYet):
        getattr(s, method)()
Ejemplo n.º 3
0
def test_no_lazy_inspect(method):

    s = Service(name='foo', client=flexmock())
    s._inspected = True
    s._inspect_data = {'State': {'Running': True}}

    getattr(s, method)()
Ejemplo n.º 4
0
def test_wrong_inspect_data():

    s = Service()
    s._inspected = True
    s._inspect_data = {'foo': 'bar'}

    assert not s.is_running()
Ejemplo n.º 5
0
def test_no_lazy_inspect(method):

    s = Service(name='foo', client=flexmock())
    s._inspected = True
    s._inspect_data = {'State': {'Running': True}}

    getattr(s, method)()
Ejemplo n.º 6
0
def test_no_lazy_inspect_not_inspected(method):

    s = Service(name='foo', client=flexmock())
    s._inspected = False

    with pytest.raises(Service.NotInspectedYet):
        getattr(s, method)()
Ejemplo n.º 7
0
def test_inspected():

    s = Service()
    s._inspected = True

    assert s.is_inspected() is True
Ejemplo n.º 8
0
def test_inspected():

    s = Service()
    s._inspected = True

    assert s.is_inspected() is True