Пример #1
0
    def test_reload_import_config(self):
        '''
        Test to re-loads the handler config XML file.
        '''
        with patch.object(solr, '_is_master', side_effect=[False, True, True]):
            with patch.object(solr,
                              '_get_none_or_value',
                              side_effect=[None, None, None, True, True]):
                with patch.object(solr,
                                  '_get_return_dict',
                                  return_value={'A': 'a'}):
                    with patch.object(solr,
                                      '_check_for_cores',
                                      side_effect=[True, False]):
                        with patch.object(solr,
                                          '_format_url',
                                          return_value='A'):
                            with patch.object(solr,
                                              '_http_request',
                                              return_value='A'):

                                self.assertDictEqual(
                                    solr.reload_import_config('h'), {'A': 'a'})

                                self.assertDictEqual(
                                    solr.reload_import_config('h'), {'A': 'a'})

                                self.assertEqual(
                                    solr.reload_import_config('h'), 'A')
Пример #2
0
 def test_reload_import_config(self):
     """
     Test to re-loads the handler config XML file.
     """
     with patch.object(solr, "_is_master", side_effect=[False, True, True]):
         with patch.object(solr,
                           "_get_none_or_value",
                           side_effect=[None, None, None, True, True]):
             with patch.object(solr,
                               "_get_return_dict",
                               return_value={"A": "a"}):
                 with patch.object(solr,
                                   "_check_for_cores",
                                   side_effect=[True, False]):
                     with patch.object(solr,
                                       "_format_url",
                                       return_value="A"):
                         with patch.object(solr,
                                           "_http_request",
                                           return_value="A"):
                             self.assertDictEqual(
                                 solr.reload_import_config("h"), {"A": "a"})
                             self.assertDictEqual(
                                 solr.reload_import_config("h"), {"A": "a"})
                             self.assertEqual(
                                 solr.reload_import_config("h"), "A")
Пример #3
0
    def test_reload_import_config(self):
        '''
        Test to re-loads the handler config XML file.
        '''
        with patch.object(solr, '_is_master', side_effect=[False, True, True]):
            with patch.object(solr, '_get_none_or_value',
                              side_effect=[None, None, None, True, True]):
                with patch.object(solr, '_get_return_dict',
                                  return_value={'A': 'a'}):
                    with patch.object(solr, '_check_for_cores',
                                      side_effect=[True, False]):
                        with patch.object(solr, '_format_url',
                                          return_value='A'):
                            with patch.object(solr, '_http_request',
                                              return_value='A'):

                                self.assertDictEqual(solr.reload_import_config
                                                     ('h'), {'A': 'a'})

                                self.assertDictEqual(solr.reload_import_config
                                                     ('h'), {'A': 'a'})

                                self.assertEqual(solr.reload_import_config('h'),
                                                 'A')