Beispiel #1
0
    def test_retrieve_addons_standalone_grouped(self):
        self.make_recipe(version='6.1',
                         addons='fakevcs lp:my-addons1 addons1 '
                         'last:1 group=grouped\nfakevcs lp:my-addons2 addons2 '
                         'last:1 group=grouped')
        # manual creation because fakevcs does nothing but retrieve_addons
        # has assertions on existence of target directories
        group_dir = os.path.join(self.buildout_dir, 'grouped')
        addons1_dir = os.path.join(group_dir, 'addons1')
        addons2_dir = os.path.join(group_dir, 'addons2')

        self.recipe.retrieve_addons()
        paths = self.recipe.addons_paths
        self.assertEquals(get_vcs_log(),
                          [(addons1_dir, 'lp:my-addons1', 'last:1',
                            dict(offline=False,
                                 clear_locks=False,
                                 clean=False,
                                 group="grouped")),
                           (addons2_dir, 'lp:my-addons2', 'last:1',
                            dict(offline=False,
                                 clear_locks=False,
                                 clean=False,
                                 group="grouped"))])
        self.assertEquals(paths, [group_dir])
Beispiel #2
0
    def test_retrieve_addons_local(self):
        """Setting up a local addons line."""
        addons_dir = os.path.join(self.buildout_dir, 'addons-custom')
        self.make_recipe(version='6.1', addons='local addons-custom')

        self.recipe.retrieve_addons()
        paths = self.recipe.addons_paths
        self.assertEquals(get_vcs_log(), [])
        self.assertEquals(paths, [addons_dir])
Beispiel #3
0
    def test_retrieve_addons_local_options(self):
        """Addons options work for 'local' by testing (useless) subdir option.
        """
        custom_dir = os.path.join(self.buildout_dir, 'custom')
        addons_dir = os.path.join(custom_dir, 'addons')
        self.make_recipe(version='6.1', addons='local custom subdir=addons')

        self.recipe.retrieve_addons()
        paths = self.recipe.addons_paths
        self.assertEquals(get_vcs_log(), [])
        self.assertEquals(paths, [addons_dir])
Beispiel #4
0
 def test_retrieve_addons_clear_locks(self):
     """Retrieving addons with vcs-clear-locks option."""
     addons_dir = os.path.join(self.buildout_dir, 'addons')
     options = dict(version='6.1', addons='fakevcs lp:my-addons addons -1')
     options['vcs-clear-locks'] = 'True'
     self.make_recipe(**options)
     self.recipe.retrieve_addons()
     self.assertEquals(
         get_vcs_log(),
         [(addons_dir, 'lp:my-addons', '-1',
           dict(offline=False, clear_locks=True, clean=False))])
Beispiel #5
0
    def test_retrieve_addons_vcs(self):
        """A VCS line in addons."""
        self.make_recipe(version='6.1',
                         addons='fakevcs http://trunk.example '
                         'addons-trunk rev')
        # manual creation because fakevcs does nothing but retrieve_addons
        # has assertions on existence of target directories
        addons_dir = os.path.join(self.buildout_dir, 'addons-trunk')

        self.recipe.retrieve_addons()
        paths = self.recipe.addons_paths
        self.assertEquals(
            get_vcs_log(),
            [(addons_dir, 'http://trunk.example', 'rev',
              dict(offline=False, clear_locks=False, clean=False))])
        self.assertEquals(paths, [addons_dir])
Beispiel #6
0
    def test_retrieve_addons_subdir(self):
        self.make_recipe(version='6.1',
                         addons='fakevcs lp:openerp-web web '
                         'last:1 subdir=addons bzrinit=branch')
        # manual creation because fakevcs does nothing but retrieve_addons
        # has assertions on existence of target directories
        web_dir = os.path.join(self.buildout_dir, 'web')
        web_addons_dir = os.path.join(web_dir, 'addons')

        self.recipe.retrieve_addons()
        paths = self.recipe.addons_paths
        self.assertEquals(get_vcs_log(), [(web_dir, 'lp:openerp-web', 'last:1',
                                           dict(offline=False,
                                                clear_locks=False,
                                                clean=False,
                                                subdir="addons",
                                                bzrinit="branch"))])
        self.assertEquals(paths, [web_addons_dir])