def testSourceMagic(self):
        d = tempfile.mkdtemp()
        try:
            # copy setup.tar.gz to a file without .gz extension
            shutil.copyfile(resources.get_archive() + '/asdf.tar.gz',
                            d + '/asdf')
            # look in our new source directory for sources
            self.cfg.sourceSearchDir = d
            r = policytest.DummyRecipe(self.cfg)
            # test the Archive class when the archive does not end in .gz
            os.mkdir('/'.join((r.macros.builddir, r.theMainDir)))
            a = source.Archive(r, 'asdf')
            a.doAction()
            assert(os.path.isdir(r.macros.builddir + '/asdf'))
            assert(os.path.isfile(r.macros.builddir + '/asdf/fdsa'))
        finally:
            shutil.rmtree(d)