mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-12-24 17:41:01 +03:00
Use zip rather than enumerate
After improving coding style, pylint suggeted using enumerate but zip is more appropriate to avoid indexing Signed-off-by: Joe Subbiani <joe.subbiani@arm.com>
This commit is contained in:
@@ -183,13 +183,13 @@ def test_all_common():
|
||||
"PSK-AES256-CBC-SHA",
|
||||
]
|
||||
|
||||
for i, m_cipher in enumerate(m_ciphers):
|
||||
for m, g_exp, o_exp in zip(m_ciphers, g_ciphers, o_ciphers):
|
||||
|
||||
g = translate_gnutls(m_cipher)
|
||||
assert_equal(g, g_ciphers[i])
|
||||
g = translate_gnutls(m)
|
||||
assert_equal(g, g_exp)
|
||||
|
||||
o = translate_ossl(m_cipher)
|
||||
assert_equal(o, o_ciphers[i])
|
||||
o = translate_ossl(m)
|
||||
assert_equal(o, o_exp)
|
||||
|
||||
def test_mbedtls_ossl_common():
|
||||
"""
|
||||
@@ -266,10 +266,10 @@ def test_mbedtls_ossl_common():
|
||||
"DHE-PSK-CHACHA20-POLY1305",
|
||||
]
|
||||
|
||||
for i, m_cipher in enumerate(m_ciphers):
|
||||
for m, o_exp in zip(m_ciphers, o_ciphers):
|
||||
|
||||
o = translate_ossl(m_cipher)
|
||||
assert_equal(o, o_ciphers[i])
|
||||
o = translate_ossl(m)
|
||||
assert_equal(o, o_exp)
|
||||
|
||||
def test_mbedtls_gnutls_common():
|
||||
"""
|
||||
@@ -456,10 +456,10 @@ def test_mbedtls_gnutls_common():
|
||||
"+RSA-PSK:+AES-128-GCM:+AEAD",
|
||||
]
|
||||
|
||||
for i, m_ciphers in enumerate(m_ciphers):
|
||||
for m, g_exp in zip(m_ciphers, g_ciphers):
|
||||
|
||||
g = translate_gnutls(m_ciphers)
|
||||
assert_equal(g, g_ciphers[i])
|
||||
g = translate_gnutls(m)
|
||||
assert_equal(g, g_exp)
|
||||
|
||||
test_all_common()
|
||||
test_mbedtls_ossl_common()
|
||||
|
||||
Reference in New Issue
Block a user