コード例 #1
0
ファイル: test_options.py プロジェクト: msabramo/simverest
 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)
コード例 #2
0
    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)
コード例 #3
0
    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)
コード例 #4
0
ファイル: test_options.py プロジェクト: msabramo/simverest
 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)
コード例 #5
0
 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)
コード例 #6
0
ファイル: test_options.py プロジェクト: msabramo/simverest
 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)