Exemplo n.º 1
0
    def testOffline(self):
        """
        Tests if install from the dowload-cache works.
        """
        testing.write(self.tempdir, 'buildout.cfg', """
[buildout]
parts = gittest
download-cache = %(cache)s

[gittest]
recipe = zerokspot.recipe.git
repository = %(repo)s
        """ % {'repo' : self.temprepo, 'cache': self.tempcache})

        # First install as usual
        build = self._buildout()
        self.assertFalse(build['gittest'].recipe.installed_from_cache)

        # clear buildout
        os.unlink(os.path.join(build['buildout']['directory'], '.installed.cfg'))
        testing.rmdir(build['buildout']['directory'], 'parts')

        # now install from cache
        build = self._buildout([('buildout', 'install-from-cache', 'true')])
        self.assertTrue(build['gittest'].recipe.installed_from_cache)
        build = self._buildout([('buildout', 'install-from-cache', 'true')])
Exemplo n.º 2
0
    def testOffline(self):
        """
        Tests if install from the dowload-cache works.
        """
        testing.write(self.tempdir, 'buildout.cfg', """
[buildout]
parts = gittest
download-cache = %(cache)s

[gittest]
recipe = zerokspot.recipe.git
repository = %(repo)s
        """ % {'repo': self.temprepo, 'cache': self.tempcache})

        # First install as usual
        build = self._buildout()
        self.assertFalse(build['gittest'].recipe.installed_from_cache)

        # clear buildout
        os.unlink(os.path.join(build['buildout']['directory'], '.installed.cfg'))
        testing.rmdir(build['buildout']['directory'], 'parts')

        # now install from cache
        build = self._buildout([('buildout', 'install-from-cache', 'true')])
        self.assertTrue(build['gittest'].recipe.installed_from_cache)
        build = self._buildout([('buildout', 'install-from-cache', 'true')])
Exemplo n.º 3
0
    def testOffline(self):
        """
        Tests if install from the dowload-cache works.
        """
        testing.write(
            self.tempdir,
            "buildout.cfg",
            """
[buildout]
parts = gittest
download-cache = %(cache)s

[gittest]
recipe = zerokspot.recipe.git
repository = %(repo)s
        """
            % {"repo": self.temprepo, "cache": self.tempcache},
        )

        # First install as usual
        build = self._buildout()
        self.assertFalse(build["gittest"].recipe.installed_from_cache)

        # clear buildout
        os.unlink(os.path.join(build["buildout"]["directory"], ".installed.cfg"))
        testing.rmdir(build["buildout"]["directory"], "parts")

        # now install from cache
        build = self._buildout([("buildout", "install-from-cache", "true")])
        self.assertTrue(build["gittest"].recipe.installed_from_cache)
Exemplo n.º 4
0
def install_projects(projects, target_dir):
    links = []
    for project in projects:
        project_dir = os.path.join(projects_dir, project)
        dist_dir = os.path.join(project_dir, 'dist')
        if os.path.isdir(dist_dir):
            testing.rmdir(dist_dir)
        dummy = testing.system("%s setup %s bdist_egg" % (
                os.path.join('bin', 'buildout'), project_dir))
        links.append(dist_dir)

    new_working_set = install(projects, target_dir, links=links,
                              working_set=working_set)

    # we must perform a magical incantation on each distribution
    for dist in new_working_set:
        dist.activate()
    return new_working_set
Exemplo n.º 5
0
def install_projects(projects, target_dir):
    links = []
    for project in projects:
        project_dir = os.path.join(projects_dir, project)
        dist_dir = os.path.join(project_dir, 'dist')
        if os.path.isdir(dist_dir):
            testing.rmdir(dist_dir)
        dummy = testing.system("%s setup %s bdist_egg" %
                               (os.path.join('bin', 'buildout'), project_dir))
        links.append(dist_dir)

    new_working_set = install(projects,
                              target_dir,
                              links=links,
                              working_set=working_set)

    # we must perform a magical incantation on each distribution
    for dist in new_working_set:
        dist.activate()
    return new_working_set
Exemplo n.º 6
0
 def tearDown(self):
     testing.rmdir(self.tempdir)
     testing.rmdir(self.tempcache)
     testing.rmdir(self.temprepos)
Exemplo n.º 7
0
 def tearDown(self):
     testing.rmdir(self.temprepo)
     testing.rmdir(self.projectdir)
Exemplo n.º 8
0
 def tearDown(self):
     testing.rmdir(self.tempdir)
     testing.rmdir(self.tempcache)
     testing.rmdir(self.temprepos)
Exemplo n.º 9
0
 def tearDown(self):
     testing.rmdir(self.temprepo)
     testing.rmdir(self.projectdir)