def test_should_handle_non_existent_formatted_ini_file(self): expectations = {'failure': False, 'successful_read': False, 'server_configs': []} ini_file_path = get_file_path('non_existent_file.ini') result = _parse_ini_file(ini_file_path) self.assertEquals(expectations, result)
def test_should_handle_badly_formatted_ini_file(self): expectations = { 'failure': True, 'successful_read': False, 'server_configs': [] } result = _parse_ini_file(BAD_INI_FILEPATH) self.assertEquals(expectations, result)
def test_should_handle_non_existent_formatted_ini_file(self): expectations = { 'failure': False, 'successful_read': False, 'server_configs': [] } ini_file_path = get_file_path('non_existent_file.ini') result = _parse_ini_file(ini_file_path) self.assertEquals(expectations, result)
def test_should_correctly_parse_good_ini_file(self): expectations = {'failure': False, 'successful_read': True, 'server_configs': [{'host': '192.168.1.23', 'password': '******', 'username': '******'}, {'host': '10.0.0.1', 'password': '******', 'username': '******'}] } result = _parse_ini_file(GOOD_INI_FILEPATH) self.assertEquals(expectations, result)
def test_should_correctly_parse_good_ini_file(self): expectations = { 'failure': False, 'successful_read': True, 'server_configs': [{ 'host': '192.168.1.23', 'password': '******', 'username': '******' }, { 'host': '10.0.0.1', 'password': '******', 'username': '******' }] } result = _parse_ini_file(GOOD_INI_FILEPATH) self.assertEquals(expectations, result)
def test_should_handle_badly_formatted_ini_file(self): expectations = {'failure': True, 'successful_read': False, 'server_configs': []} result = _parse_ini_file(BAD_INI_FILEPATH) self.assertEquals(expectations, result)