def test_with_lowercase_section(): assert data_Utils.get_connection('map', 'test_data.cfg') == (False, None)
def test_with_no_file(): assert data_Utils.get_connection('MAP', 'none') == (False, None)
def test_with_different_section(): assert data_Utils.get_connection('Map', 'test_data.cfg') == (False, None)
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'}})
def test_checkwith_wrong_file(): assert data_Utils.get_connection('MAP', 'nothing') == (False, None)
def test_checkwith_wrong_section(): assert data_Utils.get_connection('sample', 'data.cfg') == (False, None)
def test_get_map_section(): assert data_Utils.get_connection('MAP', 'data.cfg') == (True, {'MATCH_STRING': '\nNOT\nComplete to\n'})