<s> import pytest <EOL> from tls . ciphersuites import CipherSuites , select_preferred_ciphersuite <EOL> from tls . exceptions import UnsupportedCipherException <EOL> def test_ciphersuites ( ) : <EOL> assert CipherSuites . TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 . value == <NUM_LIT> <EOL> def test_select_preferred_ciphersuite ( ) : <EOL> assert select_preferred_ciphersuite ( [ <EOL> CipherSuites . TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA , <EOL> CipherSuites . TLS_DH_anon_EXPORT_WITH_RC4_40_MD5 <EOL> ] , [ <EOL> CipherSuites . TLS_DH_anon_EXPORT_WITH_RC4_40_MD5 , <EOL> CipherSuites . TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA <EOL> ] ) == CipherSuites . TLS_DH_anon_EXPORT_WITH_RC4_40_MD5 <EOL> def test_unsupported_ciphersuite ( ) : <EOL> with pytest . raises ( UnsupportedCipherException ) : <EOL> select_preferred_ciphersuite ( [ <EOL> CipherSuites . TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA <EOL> ] , [ <EOL> CipherSuites . TLS_DH_anon_EXPORT_WITH_RC4_40_MD5 <EOL> ] ) </s>
