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'))
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 }
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", ]
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, }
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']
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'))
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"))