Exemple #1
0
    def test_default_values_written_to_tracini(self):
        """Default values are written to trac.ini file."""
        config = self.env.config
        db39.do_upgrade(self.env, VERSION, None)

        self.assertFalse(config.has_option('trac', 'authz_file'))
        self.assertFalse(config.has_option('trac', 'authz_module_name'))
        self.assertFalse(config.has_option('trac', 'repository_type'))
        self.assertEqual('', config.get('svn', 'authz_file'))
        self.assertEqual('', config.get('svn', 'authz_module_name'))
        self.assertEqual('svn', config.get('versioncontrol',
                                           'default_repository_type'))
Exemple #2
0
    def test_default_values_written_to_tracini(self):
        """Default values are written to trac.ini file."""
        config = self.env.config
        db39.do_upgrade(self.env, VERSION, None)

        self.assertFalse(config.has_option('trac', 'authz_file'))
        self.assertFalse(config.has_option('trac', 'authz_module_name'))
        self.assertFalse(config.has_option('trac', 'repository_type'))
        self.assertEqual('', config.get('svn', 'authz_file'))
        self.assertEqual('', config.get('svn', 'authz_module_name'))
        self.assertEqual('svn', config.get('versioncontrol',
                                           'default_repository_type'))
Exemple #3
0
    def test_tracini_values_moved(self):
        """Values are moved in trac.ini file."""
        config = self.env.config
        config.set('trac', 'authz_file', 'authz.ini')
        config.set('trac', 'authz_module_name', 'amodule')
        config.set('trac', 'repository_type', 'git')
        config.save()
        db39.do_upgrade(self.env, VERSION, None)

        self.assertFalse(config.has_option('trac', 'authz_file'))
        self.assertFalse(config.has_option('trac', 'authz_module_name'))
        self.assertFalse(config.has_option('trac', 'repository_type'))
        self.assertEqual('authz.ini', config.get('svn', 'authz_file'))
        self.assertEqual('amodule', config.get('svn', 'authz_module_name'))
        self.assertEqual('git', config.get('versioncontrol',
                                           'default_repository_type'))
Exemple #4
0
    def test_tracini_values_moved(self):
        """Values are moved in trac.ini file."""
        config = self.env.config
        config.set('trac', 'authz_file', 'authz.ini')
        config.set('trac', 'authz_module_name', 'amodule')
        config.set('trac', 'repository_type', 'git')
        config.save()
        db39.do_upgrade(self.env, VERSION, None)

        self.assertFalse(config.has_option('trac', 'authz_file'))
        self.assertFalse(config.has_option('trac', 'authz_module_name'))
        self.assertFalse(config.has_option('trac', 'repository_type'))
        self.assertEqual('authz.ini', config.get('svn', 'authz_file'))
        self.assertEqual('amodule', config.get('svn', 'authz_module_name'))
        self.assertEqual('git', config.get('versioncontrol',
                                           'default_repository_type'))
Exemple #5
0
    def test_saves_backup(self):
        """Backup file is saved during upgrade."""
        config = self.env.config
        db39.do_upgrade(self.env, VERSION, None)

        self.assertTrue(os.path.exists(config.filename + '.db39.bak'))
Exemple #6
0
    def test_saves_backup(self):
        """Backup file is saved during upgrade."""
        config = self.env.config
        db39.do_upgrade(self.env, VERSION, None)

        self.assertTrue(os.path.exists(config.filename + '.db39.bak'))