Re: Some unit tests fail on Google App Engine SDK

"R. Tyler Ballance" <[email protected]> Mon, 12 Jul 2010 08:59:09 -0700
Newsgroups gmane.comp.python.cheetah
Message-ID <[email protected]>
On Mon, 12 Jul 2010, Rhys wrote:

> I'm not sure if this is useful, but you might like to know that some tests
> seem to fail on Google App Engine SDK for non-sandbox-related reasons.

Interesting, thanks for the report, I'll see if I can tackle this when the
weekend rolls around.

One question though, are you still largely able to use Cheetah or do this test
failures indicate a critical failure that would be preventing you from enjoying
Cheetah to its fulllest? ;)

> 
> Running Cheetah 2.4.2.1, Google App Engine SDK 1.3.5, Python 2.5.2, Ubuntu
> 9.10. All tests ran through GAEUnit (Google App Engine Unit Test Framework)
> version 1.2.8.
> 
> I have made two changes to Cheetah/Compiler.py: on line 45, I set
> useStackFrames to False and I removed the code that attempts to load the C
> version of NameMapper (forgot the line, sorry). This was to prevent Cheetah
> from complaining when it couldn't load _namemapper.so (App Engine only
> allows pure Python libraries).
> 
> I ran all tests except those in:
> 
>    - Cheetah.Tests.SyntaxAndOutput.[IncludeDirective, Backslashes]
>    - Cheetah.Tests.Template.ClassMethods_compile
>    - Cheetah.Tests.Unicode.[JBQ_UTF8_Test7, JBQ_UTF8_Test8,
>    Unicode_in_SearchList_Test]
>    - Cheetah.Tests.CheetahWrapper
> 
> I did not run the above tests because they appear to attempt to write to
> files or use the tempfile lib (which is disabled, except for
> TemporaryFilewhich is aliased to StringIO) and so they error out.
> 
> The following tests failed:
> 
>    - Cheetah.Tests.Cheps.test_InlineImport
>    - Cheetah.Tests.Unicode.test_failure
> 
> The following test raised an error:
> 
>    - Cheetah.Tests.SyntaxAndOutput.test13
> 
> I've attached the tracebacks produced by GAEUnit. Hope this helps in some
> small way!
> 
> --
> Rhys

> =================================================
> FAILURE Verify (new) inline import behavior works
> =================================================
> 
> Traceback (most recent call last):
>   File "/home/rhys/EclipseWorkspace/lyrical-3/src/Cheetah/Tests/Cheps.py", line 29, in test_InlineImport
>     self.fail('Failed to properly generate code %s' % ex)
> AssertionError: Failed to properly generate code 
> 
> Error in the Python code which Cheetah generated for this template:
> ================================================================================
> 
> expected an indented block (cheetah_DynamicallyCompiledCheetahTemplate_1278940191_43_29815.py, line 88)
> 
> Line|Python Code
> ----|-------------------------------------------------------------
> 86  |        
> 87  |        try: # generated from line 3, col 17
> 88  |        except ImportError: # generated from line 5, col 17
>                  ^
> 89  |        return urllib.quote(VFSL([locals()]+SL+[globals(), builtin],"s",True))
> 90  |        
> 91  |        ########################################
> 
> ================================================================================
> 
> Here is the corresponding Cheetah code:
> 
> Line 5, column 17
> 
> Line|Cheetah Code
> ----|-------------------------------------------------------------
> 2   |            #def funky($s)
> 3   |                #try
> 4   |                    #import urllib
> 5   |                #except ImportError
>                      ^
> 6   |                    #pass
> 7   |                #end try
> 8   |                #return urllib.quote($s)
> 
> 
> ======================================================
> FAILURE Test a template lacking a proper #encoding tag
> ======================================================
> 
> Traceback (most recent call last):
>   File "/home/rhys/EclipseWorkspace/lyrical-3/src/Cheetah/Tests/Unicode.py", line 224, in test_failure
>     'numpedidos_noconf' : ''}])
> AssertionError: UnicodeDecodeError not raised
> 
> ===============================================================
> ERROR nested dictionary access using method - alternating style
> ===============================================================
> 
> Traceback (most recent call last):
>   File "/home/rhys/EclipseWorkspace/lyrical-3/src/Cheetah/Tests/SyntaxAndOutput.py", line 995, in test13
>     "nestedItem2")
>   File "/home/rhys/EclipseWorkspace/lyrical-3/src/Cheetah/Tests/SyntaxAndOutput.py", line 176, in verify
>     output = templateObj.respond() # rather than __str__, because of unicode
>   File "cheetah_DynamicallyCompiledCheetahTemplate_1278940212_1_26989.py", line 85, in respond
>   File "/home/rhys/EclipseWorkspace/lyrical-3/src/Cheetah/NameMapper.py", line 251, in valueForName
>     return _valueForName(obj, name, executeCallables)
>   File "/home/rhys/EclipseWorkspace/lyrical-3/src/Cheetah/NameMapper.py", line 246, in _valueForName
>     obj = nextObj
> UnboundLocalError: local variable 'nextObj' referenced before assignment
> 

> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first

> _______________________________________________
> Cheetahtemplate-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss

Cheers,
-R. Tyler Ballance
--------------------------------------
  Jabber: [email protected]
  GitHub: http://github.com/rtyler
Identica: http://identi.ca/dero
 Twitter: http://twitter.com/agentdero
    Blog: http://unethicalblogger.com

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first

_______________________________________________
Cheetahtemplate-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
signature.asc (application/pgp-signature, 198 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)

iEYEARECAAYFAkw7O8wACgkQFCbH3D9R4W+0bgCgsX1owZaewidai1azcTWEK/Na
QOMAnAq48NrYKPBXFMM7LdDC77DSzSgY
=zB9I
-----END PGP SIGNATURE-----