Ejemplo n.º 1
0
def status_test():
    here = Here(
        instance=None,
        service_base_url='http://bob.com',
        id=u"tata-é$~#@\"*!'`§èû",
        modes=["walking", "bike", "car"],
        timeout=89,
    )
    status = here.status()
    assert len(status) == 6
    assert status['id'] == u'tata-é$~#@"*!\'`§èû'
    assert status['class'] == "Here"
    assert status['modes'] == ["walking", "bike", "car"]
    assert status['timeout'] == 89
    assert status['max_points'] == 100
    assert len(status['circuit_breaker']) == 3
    assert status['circuit_breaker']['current_state'] == 'closed'
    assert status['circuit_breaker']['fail_counter'] == 0
    assert status['circuit_breaker']['reset_timeout'] == 60
Ejemplo n.º 2
0
def status_test():
    here = Here(
        instance=None,
        service_base_url='http://bob.com',
        id=u"tata-é$~#@\"*!'`§èû",
        modes=["walking", "bike", "car"],
        timeout=89,
    )
    status = here.status()
    assert len(status) == 11
    assert status['id'] == u'tata-é$~#@"*!\'`§èû'
    assert status['class'] == "Here"
    assert status['modes'] == ["walking", "bike", "car"]
    assert status['timeout'] == 89
    assert status['matrix_type'] == "simple_matrix"
    assert status['max_matrix_points'] == 100
    assert status['realtime_traffic'] == "enabled"
    assert status['language'] == "en-gb"
    assert status['engine_type'] == "diesel"
    assert status['engine_average_consumption'] == 7
    assert len(status['circuit_breaker']) == 3
    assert status['circuit_breaker']['current_state'] == 'closed'
    assert status['circuit_breaker']['fail_counter'] == 0
    assert status['circuit_breaker']['reset_timeout'] == 60