def test_metrics_validate_list():
    # validate_list
    with patch.object(validate, 'mail_exchanger_lookup') as mock_method:
        mock_method.side_effect = mock_exchanger_lookup

        assert_equal(len(address.validate_list('foo@mailgun.org, bar@mailgun.org', metrics=True)), 2)
        p, m = address.validate_list('foo@mailgun.org, bar@mailgun.org', metrics=True)
        assert_equal('parsing' in m, True)
        assert_equal('mx_lookup' in m, True)
        assert_equal('dns_lookup' in m, True)
        assert_equal('mx_conn' in m, True)
        assert_equal('custom_grammar' in m, True)
        assert_equal(isinstance(address.validate_list('foo@mailgun.org, bar@mailgun.org', metrics=False), address.AddressList), True)
        assert_equal(isinstance(address.validate_list('foo@mailgun.org, bar@mailgun.org'), address.AddressList), True)
dataset/ETHPy150Open mailgun/flanker/tests/addresslib/metrics_test.py/test_metrics_validate_list/original