def test_parse_search_max_error(self): ''' handles overflow ''' test_case = self.success_test_invalid_max with mock.patch("app.send_to_database", self.mock_send_to_database): with mock.patch("apifunctions.get_homes", self.mock_get_homes): result = app.parsing_search_parameters(test_case[KEY_INPUT])
def test_parse_search_parameters(self, mock_socket): ''' Regular search ''' test_case = self.success_test_params with mock.patch("app.send_to_database", self.mock_send_to_database): with mock.patch("apifunctions.get_homes", self.mock_get_homes): result = app.parsing_search_parameters(test_case[KEY_INPUT]) mock_socket.assert_called_with("sending listing", [])
def test_parse_search_parameters_rental(self, mock_socket): ''' Rental Search ''' test_case = self.success_test_params_rental with mock.patch("app.send_to_database", self.mock_send_to_database): with mock.patch("rental_listings_api.get_rental_listings", self.mock_get_rental_listings): result = app.parsing_search_parameters(test_case[KEY_INPUT]) mock_socket.assert_called_with("sending listing", [])