Exemplo n.º 1
0
def test_sum_of_statistics_sums_inputs():
    delivery_statistics = [{
        'emails_delivered': 1,
        'emails_requested': 2,
        'emails_failed': 3,
        'sms_requested': 4,
        'sms_delivered': 5,
        'sms_failed': 6
    }, {
        'emails_delivered': 10,
        'emails_requested': 20,
        'emails_failed': 30,
        'sms_requested': 40,
        'sms_delivered': 50,
        'sms_failed': 60
    }]
    resp = sum_of_statistics(delivery_statistics)

    assert resp == {
        'emails_delivered': 11,
        'emails_requested': 22,
        'emails_failed': 33,
        'sms_requested': 44,
        'sms_delivered': 55,
        'sms_failed': 66
    }
def test_sum_of_statistics_sums_inputs():
    delivery_statistics = [
        {
            'emails_delivered': 1,
            'emails_requested': 2,
            'emails_failed': 3,
            'sms_requested': 4,
            'sms_delivered': 5,
            'sms_failed': 6
        },
        {
            'emails_delivered': 10,
            'emails_requested': 20,
            'emails_failed': 30,
            'sms_requested': 40,
            'sms_delivered': 50,
            'sms_failed': 60
        }
    ]
    resp = sum_of_statistics(delivery_statistics)

    assert resp == {
        'emails_delivered': 11,
        'emails_requested': 22,
        'emails_failed': 33,
        'sms_requested': 44,
        'sms_delivered': 55,
        'sms_failed': 66
    }
def test_sum_of_statistics_sums_inputs():
    delivery_statistics = [
        {
            "emails_delivered": 1,
            "emails_requested": 2,
            "emails_failed": 3,
            "sms_requested": 4,
            "sms_delivered": 5,
            "sms_failed": 6,
        },
        {
            "emails_delivered": 10,
            "emails_requested": 20,
            "emails_failed": 30,
            "sms_requested": 40,
            "sms_delivered": 50,
            "sms_failed": 60,
        },
    ]
    resp = sum_of_statistics(delivery_statistics)

    assert resp == {
        "emails_delivered": 11,
        "emails_requested": 22,
        "emails_failed": 33,
        "sms_requested": 44,
        "sms_delivered": 55,
        "sms_failed": 66,
    }
Exemplo n.º 4
0
def test_sum_of_statistics_puts_in_defaults_of_zero(delivery_statistics):
    resp = sum_of_statistics(delivery_statistics)

    assert resp == {
        'emails_delivered': 0,
        'emails_requested': 0,
        'emails_failed': 0,
        'sms_requested': 0,
        'sms_delivered': 0,
        'sms_failed': 0
    }
def test_sum_of_statistics_puts_in_defaults_of_zero(delivery_statistics):
    resp = sum_of_statistics(delivery_statistics)

    assert resp == {
        'emails_delivered': 0,
        'emails_requested': 0,
        'emails_failed': 0,
        'sms_requested': 0,
        'sms_delivered': 0,
        'sms_failed': 0
    }