lots of small bugfixes

This commit is contained in:
Dave Halter
2014-01-12 02:15:59 +01:00
parent b93c761db6
commit 0bff729294
5 changed files with 14 additions and 10 deletions

View File

@@ -8,8 +8,8 @@ from pytest import raises
def test_preload_modules():
def check_loaded(*modules):
# + 1 for builtin, +1 for None module (currently used)
assert len(new) == len(modules) + 2
# +1 for None module (currently used)
assert len(new) == len(modules) + 1
for i in modules + ('__builtin__',):
assert [i in k for k in new.keys() if k is not None]
@@ -20,9 +20,8 @@ def test_preload_modules():
new['__builtin__'] = temp_cache['__builtin__']
api.preload_module('datetime')
check_loaded('datetime')
api.preload_module('json', 'token')
check_loaded('datetime', 'json', 'token')
check_loaded('json', 'token')
cache.parser_cache = temp_cache