<s> import unittest <EOL> from flexmock import flexmock_teardown <EOL> from tests . util . global_reactor import cisco_switch_ip , cisco_auto_enabled_switch_ssh_port , cisco_auto_enabled_switch_telnet_port <EOL> from tests . util . protocol_util import SshTester , TelnetTester , with_protocol <EOL> class TestCiscoAutoEnabledSwitchProtocol ( unittest . TestCase ) : <EOL> __test__ = False <EOL> def setUp ( self ) : <EOL> self . protocol = self . create_client ( ) <EOL> def tearDown ( self ) : <EOL> flexmock_teardown ( ) <EOL> @ with_protocol <EOL> def test_enable_command_requires_a_password ( self , t ) : <EOL> t . write ( "<STR_LIT>" ) <EOL> t . read ( "<STR_LIT>" ) <EOL> t . write ( "<STR_LIT>" ) <EOL> t . read ( "<STR_LIT>" ) <EOL> t . write ( "<STR_LIT>" ) <EOL> t . read ( "<STR_LIT>" ) <EOL> t . write ( "<STR_LIT>" ) <EOL> t . readln ( "<STR_LIT>" ) <EOL> t . read ( "<STR_LIT>" ) <EOL> t . write ( "<STR_LIT>" ) <EOL> t . read ( "<STR_LIT>" ) <EOL> def create_client ( self ) : <EOL> raise NotImplementedError ( ) <EOL> class TestCiscoSwitchProtocolSSH ( TestCiscoAutoEnabledSwitchProtocol ) : <EOL> __test__ = True <EOL> def create_client ( self ) : <EOL> return SshTester ( "<STR_LIT>" , cisco_switch_ip , cisco_auto_enabled_switch_ssh_port , '<STR_LIT:root>' , '<STR_LIT:root>' ) <EOL> class TestCiscoSwitchProtocolTelnet ( TestCiscoAutoEnabledSwitchProtocol ) : <EOL> __test__ = True <EOL> def create_client ( self ) : <EOL> return TelnetTester ( "<STR_LIT>" , cisco_switch_ip , cisco_auto_enabled_switch_telnet_port , '<STR_LIT:root>' , '<STR_LIT:root>' ) </s>
