def test_load_scripts_no_cache(): names = ['sum', 'unicode'] scripts = load_scripts( names=names, path=LUA_SEARCH_PATH, ) assert_equal(set(names), {script.name for script in scripts.values()}) assert_equal(set(names), set(scripts.keys()))
def test_load_scripts_cache_hit(): names = ['sum', 'foo'] cache = { 'foo': Script( name='foo', regions=[TextRegion(content='')], ), } scripts = load_scripts( names=names, path=LUA_SEARCH_PATH, cache=cache, ) assert_equal(set(names), {script.name for script in scripts.values()}) assert_equal(set(names), set(scripts.keys())) assert_equal( { 'sum': scripts['sum'], 'foo': scripts['foo'], }, cache, )