Search API Unit Tests

88 views
Skip to first unread message

jeffgnpc

unread,
Aug 29, 2012, 7:12:57 PM8/29/12
to google-a...@googlegroups.com
I didn't see a LocalService object for the Search API, so I don't know how to reset the index after unit tests.  How are people unit testing their code around Search API?

Jason Galea

unread,
Aug 29, 2012, 7:42:08 PM8/29/12
to google-a...@googlegroups.com
removing all the documents at teardown appears to work.. (I only had one test previously so I hadn't noticed the issue..)



On Thu, Aug 30, 2012 at 9:12 AM, jeffgnpc <jeff...@gmail.com> wrote:
I didn't see a LocalService object for the Search API, so I don't know how to reset the index after unit tests.  How are people unit testing their code around Search API?

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine/-/JMIDpqM1vhoJ.
To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.



--
Jason Galea


Jason Galea

unread,
Jan 19, 2013, 6:43:35 PM1/19/13
to google-a...@googlegroups.com
fyi.. I recently found..

from google.appengine.api.search.simple_search_stub import SearchServiceStub
SEARCH_SERVICE_NAME = "search"

    def setUp(self):
        self.testbed = testbed.Testbed()
        self.testbed.activate()
        ...
        stub = SearchServiceStub()
        self.testbed._register_stub(SEARCH_SERVICE_NAME, stub)

I think it's still undocumented, but working ok for me.. (after finding that removing all the documents doesn't always work..)

J

On Thursday, 30 August 2012 09:42:26 UTC+10, Jason Galea wrote:
removing all the documents at teardown appears to work.. (I only had one test previously so I hadn't noticed the issue..)

On Thu, Aug 30, 2012 at 9:12 AM, jeffgnpc wrote:
I didn't see a LocalService object for the Search API, so I don't know how to reset the index after unit tests.  How are people unit testing their code around Search API?

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine/-/JMIDpqM1vhoJ.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to google-appengine+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages