def test_send_request_payload_errors(self, arg): err_msg = "Missing or invalid payload argument." session = SolrSession("my_client_key", "example.com") with pytest.raises(BookopsSolrError) as exc: session._send_request(arg) assert err_msg in str(exc.value) session.close()
def test_prep_response_fields_exception(self, arg): err_msg = "Invalid type of 'reposponse_format' argument." session = SolrSession("my_client_key", "example.com") with pytest.raises(BookopsSolrError) as exc: session._prep_response_fields(arg) assert err_msg in str(exc.value) session.close()
def test_determine_response_fields(self, arg_def, arg_field, expectation): session = SolrSession("my_client_key", "example.com") assert (session._determine_response_fields( default_response_fields=arg_def, response_fields=arg_field) == expectation) session.close()
def test_prep_response_fields(self, arg, expectation): session = SolrSession("my_client_key", "example.com") assert session._prep_response_fields(arg) == expectation session.close()
def test_merge_payload_with_defaults(self, arg, expectation): session = SolrSession("my_client_key", "example.com") assert session._merge_with_payload_defaults(arg) == expectation session.close()