#NEWLINE# def test_create_config( self ) : #NEWLINE# #INDENT# cfg . CONF . set_override ( 'templates_path' , templates_path , 'general' ) #NEWLINE# credentials_info = { #NEWLINE# #INDENT# 'user_name' : 'bob' , #NEWLINE# 'password' : 'tooEasy' , #NEWLINE# #UNINDENT# } #NEWLINE# fake_mgmt_port = { #NEWLINE# #INDENT# 'fixed_ips' : [ { #NEWLINE# #INDENT# 'ip_address' : '10.0.0.55' , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } #NEWLINE# connectivity_info = { #NEWLINE# #INDENT# 'mgmt_port' : fake_mgmt_port , #NEWLINE# 'netmask' : '255.255.255.0' , #NEWLINE# 'gateway_ip' : '10.0.0.1' , #NEWLINE# 'name_server_1' : '8.8.8.8' , #NEWLINE# 'name_server_2' : '8.8.4.4' , #NEWLINE# #UNINDENT# } #NEWLINE# driver = CSR1kvHostingDeviceDriver ( ) #NEWLINE# context_mock = mock . MagicMock ( ) #NEWLINE# res = driver . create_config ( context_mock , credentials_info , connectivity_info ) #NEWLINE# self . assertEqual ( len ( res ) , 1 ) #NEWLINE# self . assertIn ( 'iosxe_config.txt' , res ) #NEWLINE# line_set = { item for item in res [ 'iosxe_config.txt' ] . split ( '\n' ) } #NEWLINE# self . assertIn ( 'username bob priv 15 secret tooEasy' , line_set ) #NEWLINE# self . assertIn ( ' ip address 10.0.0.55 255.255.255.0' , line_set ) #NEWLINE# self . assertIn ( 'ip route 0.0.0.0 0.0.0.0 GigabitEthernet1 10.0.0.1' , line_set ) #NEWLINE# self . assertIn ( 'ip name-server 8.8.8.8' , line_set )