<s> from env_vars_fetcher . bastion_utilities import CFConfExtractor <EOL> import mock <EOL> import yaml <EOL> class TestSSHConnectionToBastion : <EOL> @ classmethod <EOL> def setup_class ( cls ) : <EOL> cls . default_config_name = '<STR_LIT>' <EOL> cls . json_config = { <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : True , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : <NUM_LIT> , <EOL> '<STR_LIT:username>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None , <EOL> '<STR_LIT>' : None <EOL> } , <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> } <EOL> mock_config_content = yaml . dump ( cls . json_config ) <EOL> with mock . patch ( '<STR_LIT>' , mock . mock_open ( read_data = mock_config_content ) , create = True ) as m : <EOL> cls . cfUtilities = CFConfExtractor ( ) <EOL> def test_create_without_arg_uses_default_filename ( self ) : <EOL> """<STR_LIT>""" <EOL> assert self . cfUtilities . config_filename == self . default_config_name <EOL> assert self . cfUtilities . _hostname == self . json_config [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] <EOL> assert self . cfUtilities . _hostport == self . json_config [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] <EOL> assert self . cfUtilities . _username == self . json_config [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT:username>' ] <EOL> assert self . cfUtilities . _key_filename == self . json_config [ '<STR_LIT>' ] [ '<STR_LIT>' ] [ '<STR_LIT>' ] <EOL> def test_check_is_smtp_protocol_for_smtp_port ( self ) : <EOL> """<STR_LIT>""" <EOL> assert '<STR_LIT>' == self . cfUtilities . _determine_smtp_protocol ( <NUM_LIT> ) <EOL> assert '<STR_LIT>' == self . cfUtilities . _determine_smtp_protocol ( <NUM_LIT> ) <EOL> assert '<STR_LIT>' == self . cfUtilities . _determine_smtp_protocol ( <NUM_LIT> ) <EOL> def test_check_is_smtps_protocol_for_smtps_port ( self ) : <EOL> """<STR_LIT>""" <EOL> assert '<STR_LIT>' == self . cfUtilities . _determine_smtp_protocol ( <NUM_LIT> ) <EOL> def test_check_is_not_returned_protocol_for_unknown_custom_port ( self ) : <EOL> """<STR_LIT>""" <EOL> assert None == self . cfUtilities . _determine_smtp_protocol ( <NUM_LIT> ) </s>
