예제 #1
0
 def test_old_config(self, qapp, tmpdir, filename):
     """Check if upgrading old configs works correctly."""
     full_path = os.path.join(os.path.dirname(__file__), 'old_configs',
                              filename)
     shutil.copy(full_path, str(tmpdir / 'qutebrowser.conf'))
     conf = config.ConfigManager()
     conf.read(str(tmpdir), 'qutebrowser.conf')
예제 #2
0
 def objects(self, tmpdir):
     cp = configparser.ConfigParser(interpolation=None,
                                    comment_prefixes='#')
     cp.optionxform = lambda opt: opt  # be case-insensitive
     cfg = config.ConfigManager()
     cfg.read(str(tmpdir), 'qutebrowser.conf')
     return self.Objects(cp=cp, cfg=cfg)
예제 #3
0
def default_config():
    """Fixture that provides and registers an empty default config object."""
    config_obj = config.ConfigManager()
    config_obj.read(configdir=None, fname=None, relaxed=True)
    objreg.register('config', config_obj)
    yield config_obj
    objreg.delete('config')
예제 #4
0
 def test_default_config(self):
     """Test validating of the default config."""
     conf = config.ConfigManager()
     conf.read(None, None)
     conf._validate_all()
예제 #5
0
 def test_default_config(self, tmpdir):
     """Test validating of the default config."""
     conf = config.ConfigManager()
     conf.read(str(tmpdir), 'qutebrowser.conf')
     conf._validate_all()
예제 #6
0
 def setUp(self):
     self.cp = configparser.ConfigParser(interpolation=None,
                                         comment_prefixes='#')
     self.cp.optionxform = lambda opt: opt  # be case-insensitive
     self.cfg = config.ConfigManager(None, None)