예제 #1
0
def test_with_lowercase_section():
    assert  data_Utils.get_connection('map', 'test_data.cfg') == (False, None)
예제 #2
0
def test_with_no_file():
    assert  data_Utils.get_connection('MAP', 'none') == (False, None)
예제 #3
0
def test_with_different_section():
    assert data_Utils.get_connection('Map', 'test_data.cfg') == (False, None)
예제 #4
0
def test_get_the_cred_section():
   assert  data_Utils.get_connection('CREDENTIALS', 'test_data.cfg') == (True, {'DEFAULT': 'device1', 'device1': {'ip': '167.254.218.113', 'nc_port': '16029', 'username': '******', 'password': '******', 'hostkey_verify': 'False'}, 'device2': {'ip': '167.254.218.113', 'nc_port': '16029', 'username': '******', 'password': '******', 'hostkey_verify': 'False'}})
예제 #5
0
def test_checkwith_wrong_file():
   assert data_Utils.get_connection('MAP', 'nothing') == (False, None)
예제 #6
0
def test_checkwith_wrong_section():
   assert  data_Utils.get_connection('sample', 'data.cfg') == (False, None)
예제 #7
0
def test_get_map_section():
   assert  data_Utils.get_connection('MAP', 'data.cfg') == (True, {'MATCH_STRING': '\nNOT\nComplete to\n'})