Exemplo n.º 1
0
def test_get_status_filters_constructs_links(app_):
    with app_.test_request_context():
        ret = get_status_filters({'id': 'foo'}, 'sms', STATISTICS)

    link = ret[0][2]
    assert link == '/services/foo/notifications/sms?status={}'.format(
        quote('sending,delivered,failed'))
Exemplo n.º 2
0
def test_get_status_filters_calculates_stats(client):
    ret = get_status_filters(Service({'id': 'foo'}), 'sms', STATISTICS)

    assert {label: count for label, _option, _link, count in ret} == {
        'total': 6,
        'sending': 3,
        'failed': 2,
        'delivered': 1
    }
Exemplo n.º 3
0
def test_get_status_filters_in_right_order(client):
    ret = get_status_filters(Service({"id": "foo"}), "sms", STATISTICS)

    assert [label for label, _option, _link, _count in ret] == [
        "total",
        "sending",
        "delivered",
        "failed",
    ]
Exemplo n.º 4
0
def test_get_status_filters_calculates_stats(client):
    ret = get_status_filters(Service({"id": "foo"}), "sms", STATISTICS)

    assert {label: count
            for label, _option, _link, count in ret} == {
                "total": 6,
                "sending": 3,
                "failed": 2,
                "delivered": 1,
            }
Exemplo n.º 5
0
def test_get_status_filters_calculates_stats(app_):
    with app_.test_request_context():
        ret = get_status_filters({'id': 'foo'}, 'sms', STATISTICS)

    assert {label: count
            for label, _option, _link, count in ret} == {
                'total': 6,
                'sending': 3,
                'failed': 2,
                'delivered': 1
            }
def test_get_status_filters_in_right_order(client):
    ret = get_status_filters({'id': 'foo'}, 'sms', STATISTICS)

    assert [label for label, _option, _link, _count in ret
            ] == ['total', 'sending', 'delivered', 'failed']
Exemplo n.º 7
0
def test_get_status_filters_constructs_links(client):
    ret = get_status_filters(Service({'id': 'foo'}), 'sms', STATISTICS)

    link = ret[0][2]
    assert link == '/services/foo/notifications/sms?status={}'.format(quote('sending,delivered,failed'))
Exemplo n.º 8
0
def test_get_status_filters_constructs_links(client):
    ret = get_status_filters(Service({"id": "foo"}), "sms", STATISTICS)

    link = ret[0][2]
    assert link == "/services/foo/notifications/sms?status={}".format(
        quote("sending,delivered,failed"))