Working on upgrading my from Pylons 0.9.7 to 1.0. However, my tests
now fail because the code (and the tests themselves) use app_globals
which does not seem to be available. The code I use is:
data_dir = config['pylons.app_globals'].lz_data_dir
I use this in the test code itself and from within a module in app/
lib.
However when I run my unit tests:
Traceback (most recent call last):
File "/opt/wgen-3p/python26/lib/python2.6/site-packages/nose/
case.py",
line 186, in runTest
self.test(*self.arg)
File "/opt/wgen-3p/python26/lib/python2.6/site-packages/nose/
util.py",
line 634, in newfunc
return func(*arg, **kw)
File "/opt/wgen-3p/python26/lib/python2.6/site-packages/mock.py",
line 196, in patched
return func(*args, **keywargs)
File
"/home/cangove/code/landing-zone/src/landing_zone/tests/functional/
test_
wait_for_lzid.py", line 33, in test_one_collision
find_results = [[LzFilePath(Status.uploaded, 'test', '1')], []]
File
"/home/cangove/code/landing-zone/src/landing_zone/lib/lz_paths.py",
line 42, in __init__
self._data_dir = data_dir or
config['pylons.app_globals'].lz_data_dir
AttributeError: 'NoneType' object has no attribute 'lz_data_dir'
So why is config['pylons.app_globals'] set to None? If app_globals is
not usable in this context shouldn't it just not exist in the config
object? Also why would this not be valid, I though using nostests with
the -with-pylons loaded the config and thus globals up. Anyone know
why this no longer works in Pylons 1.0? Workarounds?
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en.