def setup(r):
        r.addSource('test', sourceDir = '')"""

        class Stop(Exception):
            pass

        def mockDoDownload(x):
            f = x._findSource(x.httpHeaders)
            self.assertEquals(f, os.path.join(x.builddir,
                                              x.recipe.macros.maindir,
                                              'test'))
            raise Stop

        def mockFindAll(*args, **kwargs):
            raise AssertionError('lookaside cache should not have been used')

        self.mock(source.addSource, 'doDownload', mockDoDownload)
        self.mock(lookaside, 'findAll', mockFindAll)

        self.assertRaises(Stop, self.buildRecipe,
                recipeStr, "TestAddSourceDir")