Merge lp:~ceronman/txsolr/print-solrresponse-707518 into lp:txsolr
Proposed by
Manuel Cerón
Status: | Merged |
---|---|
Merged at revision: | 54 |
Proposed branch: | lp:~ceronman/txsolr/print-solrresponse-707518 |
Merge into: | lp:txsolr |
Diff against target: |
63 lines (+18/-2) 3 files modified
txsolr/__init__.py (+1/-0) txsolr/response.py (+2/-1) txsolr/test/test_response.py (+15/-1) |
To merge this branch: | bzr merge lp:~ceronman/txsolr/print-solrresponse-707518 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jamu Kakar (community) | Approve | ||
txsolr-dev | Pending | ||
Review via email: mp+62052@code.launchpad.net |
Description of the change
This branch introduces the following changes:
- Solr responses now can be printed without AttributeError raising.
- txSolr logger doesn't propagate messages to higher level loggers.
To post a comment you must log in.
[1]
+ def testSolrRespons eRepr(self) : :{"numFound" :0,"start" :0,"docs" :[]} e(raw) l('SolrResponse : %r' % raw, repr(response))
+ """A L{SolrResponse} representation shows the raw response."""
+ raw = '''{
+ "responseHeader":{
+ "status":0,
+ "QTime":2,
+ "params":{
+ "indent":"on",
+ "wt":"json",
+ "q":"manuel"}},
+ "response"
+ }'''
+ response = JSONSolrRespons
+ self.assertEqua
I think you should dump JSON here instead of constructing it by hand:
def testSolrRespons eRepr(self) : 'responseHeader ': {'status': 0,
' QTime': 2,
' params' : {'indent': 'on',
'wt' : 'json',
'q': 'manuel'}},
'response' : {'numFound': 0,
'start' : 0,
'docs': []}}) e(rawResponse)
self.assertEqu al('SolrRespons e: %r' % rawResponse, repr(response))
"""A L{SolrResponse} representation shows the raw response."""
rawResponse = dumps({
response = JSONSolrRespons
Nice work, +1!