mirror of
				https://github.com/cuberite/polarssl.git
				synced 2025-11-04 04:32:24 -05: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:
		
							parent
							
								
									a56e10db4c
								
							
						
					
					
						commit
						3eac5b9c6d
					
				@ -183,13 +183,13 @@ def test_all_common():
 | 
				
			|||||||
        "PSK-AES256-CBC-SHA",
 | 
					        "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)
 | 
					        g = translate_gnutls(m)
 | 
				
			||||||
        assert_equal(g, g_ciphers[i])
 | 
					        assert_equal(g, g_exp)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        o = translate_ossl(m_cipher)
 | 
					        o = translate_ossl(m)
 | 
				
			||||||
        assert_equal(o, o_ciphers[i])
 | 
					        assert_equal(o, o_exp)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def test_mbedtls_ossl_common():
 | 
					def test_mbedtls_ossl_common():
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
@ -266,10 +266,10 @@ def test_mbedtls_ossl_common():
 | 
				
			|||||||
        "DHE-PSK-CHACHA20-POLY1305",
 | 
					        "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)
 | 
					        o = translate_ossl(m)
 | 
				
			||||||
        assert_equal(o, o_ciphers[i])
 | 
					        assert_equal(o, o_exp)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def test_mbedtls_gnutls_common():
 | 
					def test_mbedtls_gnutls_common():
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
@ -456,10 +456,10 @@ def test_mbedtls_gnutls_common():
 | 
				
			|||||||
        "+RSA-PSK:+AES-128-GCM:+AEAD",
 | 
					        "+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)
 | 
					        g = translate_gnutls(m)
 | 
				
			||||||
        assert_equal(g, g_ciphers[i])
 | 
					        assert_equal(g, g_exp)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_all_common()
 | 
					test_all_common()
 | 
				
			||||||
test_mbedtls_ossl_common()
 | 
					test_mbedtls_ossl_common()
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user