Ejemplo n.º 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(), '')
Ejemplo n.º 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(), "")
Ejemplo n.º 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(), '')
Ejemplo n.º 4
0
 def __init__(self):
   """ Constructor for solr interface. """
   self._search_location = appscale_info.get_search_location()
Ejemplo n.º 5
0
 def __init__(self):
     """ Constructor for solr interface. """
     self._search_location = 'http://{}:{}'.format(
         appscale_info.get_search_location(), SOLR_SERVER_PORT)
Ejemplo n.º 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(), "")
Ejemplo n.º 7
0
 def __init__(self):
   """ Constructor for solr interface. """
   self._search_location = 'http://{}:{}'.format(
     appscale_info.get_search_location(), SOLR_SERVER_PORT
   )