Пример #1
0
 def test_get_search_location(self, read_mock):
   # File exists
   read_mock.return_value = 'private_ip:port'
   self.assertEquals(appscale_info.get_search_location(), 'private_ip:port')
   # IO Error
   read_mock.side_effect = IOError('Boom')
   self.assertEquals(appscale_info.get_search_location(), '')
Пример #2
0
    def test_get_search_location(self):
        flexmock(file_io).should_receive("read").and_return("private_ip:port")
        self.assertEquals(appscale_info.get_search_location(),
                          "private_ip:port")

        flexmock(file_io).should_receive("read").and_raise(IOError)
        self.assertEquals(appscale_info.get_search_location(), "")
Пример #3
0
 def test_get_search_location(self, read_mock):
     # File exists
     read_mock.return_value = 'private_ip:port'
     self.assertEquals(appscale_info.get_search_location(),
                       'private_ip:port')
     # IO Error
     read_mock.side_effect = IOError('Boom')
     self.assertEquals(appscale_info.get_search_location(), '')
Пример #4
0
 def __init__(self):
   """ Constructor for solr interface. """
   self._search_location = appscale_info.get_search_location()
Пример #5
0
 def __init__(self):
     """ Constructor for solr interface. """
     self._search_location = 'http://{}:{}'.format(
         appscale_info.get_search_location(), SOLR_SERVER_PORT)
Пример #6
0
  def test_get_search_location(self):
    flexmock(file_io).should_receive("read").and_return("private_ip:port")
    self.assertEquals(appscale_info.get_search_location(), "private_ip:port")

    flexmock(file_io).should_receive("read").and_raise(IOError)
    self.assertEquals(appscale_info.get_search_location(), "")
Пример #7
0
 def __init__(self):
   """ Constructor for solr interface. """
   self._search_location = 'http://{}:{}'.format(
     appscale_info.get_search_location(), SOLR_SERVER_PORT
   )