<s> import testtools <EOL> from sahara . utils import crypto as c <EOL> class CryptoTest ( testtools . TestCase ) : <EOL> def test_generate_key_pair ( self ) : <EOL> kp = c . generate_key_pair ( ) <EOL> self . assertIsInstance ( kp , tuple ) <EOL> self . assertIsNotNone ( kp [ <NUM_LIT:0> ] ) <EOL> self . assertIsNotNone ( kp [ <NUM_LIT:1> ] ) <EOL> self . assertIn ( '<STR_LIT>' , kp [ <NUM_LIT:0> ] ) <EOL> self . assertIn ( '<STR_LIT>' , kp [ <NUM_LIT:0> ] ) <EOL> self . assertIn ( '<STR_LIT>' , kp [ <NUM_LIT:1> ] ) <EOL> self . assertIn ( '<STR_LIT>' , kp [ <NUM_LIT:1> ] ) <EOL> def test_to_paramiko_private_key ( self ) : <EOL> pk_str = c . generate_key_pair ( ) [ <NUM_LIT:0> ] <EOL> pk = c . to_paramiko_private_key ( pk_str ) <EOL> self . assertIsNotNone ( pk ) <EOL> self . assertEqual ( <NUM_LIT> , pk . size ) <EOL> self . assertEqual ( '<STR_LIT>' , pk . get_name ( ) ) </s>
