Unit test failure with 1.1.3 release

18 views
Skip to first unread message

Jason Etheridge

unread,
Sep 20, 2008, 6:56:16 AM9/20/08
to Google App Engine
When I upgraded to 1.1.3 from 1.1.2, my App Engine unit tests (built
using the scheme described in another post [1]) started failing with
the following stack trace:

...
File "C:/Program Files/Google/google_appengine\google\appengine\ext\db
\__init__.py", line 617, in put
self._populate_internal_entity()
File "C:/Program Files/Google/google_appengine\google\appengine\ext\db
\__init__.py", line 599, in _populate_internal_entity
self._entity = self._populate_entity(_entity_class=_entity_class)
File "C:/Program Files/Google/google_appengine\google\appengine\ext\db
\__init__.py", line 645, in _populate_entity
_app=self._app)
File "C:/Program Files/Google/google_appengine\google\appengine\api
\datastore.py", line 288, in __init__
_app = datastore_types.ResolveAppId(_app)
File "C:/Program Files/Google/google_appengine\google\appengine\api
\datastore_types.py", line 120, in ResolveAppId
ValidateString(app, '_app', datastore_errors.BadArgumentError)
File "C:/Program Files/Google/google_appengine\google\appengine\api
\datastore_types.py", line 97, in ValidateString
raise exception('%s must not be empty.' % name)
adArgumentError: _app must not be empty.

It turns out that as of 1.1.3, a value for APPLICATION_ID must be
added to your unit test's environment. Easy enough to fix, once I
worked out what was going on.

[1]
http://groups.google.com/group/google-appengine/browse_thread/thread/9bf8102ae975c94c/72c4de36f11ffb02?lnk=gst&q=unittest#72c4de36f11ffb02

I.K.

unread,
Sep 21, 2008, 3:33:17 PM9/21/08
to Google App Engine
Hi,

I'm suffering with the same problem since upgrading to 1.1.3.

I have always included the first argument here:
stub =
datastore_file_stub.DatastoreFileStub(u'myTemporaryDataStorage', '/dev/
null', '/dev/null')

Do you have any more information on what you changed to correct your
problem please?

Thanks

Jason Etheridge

unread,
Sep 22, 2008, 3:46:20 PM9/22/08
to google-a...@googlegroups.com, iain....@gmail.com
On Mon, Sep 22, 2008 at 5:33 AM, I.K. <iain....@gmail.com> wrote:
> I'm suffering with the same problem since upgrading to 1.1.3.
>
> I have always included the first argument here:
> stub =
> datastore_file_stub.DatastoreFileStub(u'myTemporaryDataStorage', '/dev/
> null', '/dev/null')
>
> Do you have any more information on what you changed to correct your
> problem please?

I added the following in my test setup:

os.environ['APPLICATION_ID'] = APP_ID

... along with the other environment variables that are locally set
(AUTH_DOMAIN and USER_EMAIL). This was done after the call to create
my DataStoreFileStub instance. No other change was necessary.

Hope that helps!

--
Jason Etheridge
mailto:jaso...@gmail.com

I.K.

unread,
Sep 23, 2008, 4:14:45 AM9/23/08
to Google App Engine
Excellent, that has done the trick.

Now back to fixing my real failing tests ;)

Thanks.

On Sep 22, 8:46 pm, "Jason Etheridge" <jason...@gmail.com> wrote:
> mailto:jason...@gmail.com
Reply all
Reply to author
Forward
0 new messages