aschmid00
aschmid00

Reputation: 7158

nosegae blobstore support?

im trying to find out if nosegae supports the blobstore for tests like it does for the datastore. im having troubles to test a blobstore upload. does anyone know more about it?

thank you.

edit:

blob is a BlobReferenceProperty()

right now im having some issues. probably because im missing something. if i try to add an entity with a blob like this:

e = entity(title=title, blob=open('/path/to/image.jpg').read())
e.put()

i get a

   File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/api/datastore_types.py", line 113, in ValidateString
    if len(value.encode('utf-8')) > max_len:
UnicodeDecodeError: 'ascii' codec can't decode byte 0xff in position 0: ordinal not in range(128)

if i use

...
 blob=open('/path/to/image.jpg', 'r')
...

the result is:

File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/google/appengine/ext/blobstore/blobstore.py", line 429, in get_value_for_datastore
    return blob_info.key()
AttributeError: 'file' object has no attribute 'key'

then if i use webtest.TestApp try to use an uplaod url like '/_ah/upload/....' i get a 404. i guess because my app doesnt cover the '/_ah/upload/...' urls.

any hints?

Upvotes: 0

Views: 215

Answers (1)

Nick Johnson
Nick Johnson

Reputation: 101149

It should do - NoseGAE simply uses the dev_appserver's code to set up the environment identically.

Upvotes: 1

Related Questions