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>
diff --git a/tests/scripts/test_translate_ciphers_names.py b/tests/scripts/test_translate_ciphers_names.py
index c40d376..84bcc99 100755
--- a/tests/scripts/test_translate_ciphers_names.py
+++ b/tests/scripts/test_translate_ciphers_names.py
@@ -183,13 +183,13 @@
"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 @@
"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 @@
"+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()