예제 #1
0
    def test_values_are_saved(self):
        config.open_config()
        config.set_value('accent_color', 'blue')
        config.save_config()
        config.config_values = None
        config.open_config()

        self.assertEqual(config.get_value('accent_color'), 'blue')
예제 #2
0
    def test_missing_values_are_supplied(self):
        file_system.create_directory(Path('~/.texviper'))
        file_system.create_file(Path('~/.texviper/config.json'))
        file_system.write(Path('~/.texviper/config.json'),
                          '{ "accent_color": "purple }"')

        config.open_config()
        self.assertTrue('editor_font' in config.config_values)
예제 #3
0
 def setUpClass(cls):
     config.open_config(use_default=True)
예제 #4
0
    def test_config_contains_data(self):
        config.open_config()

        default_config = config.open_default_config()
        for prop in default_config:
            self.assertTrue(prop in config.config_values)
예제 #5
0
    def test_config_is_created(self):
        config.open_config()

        self.assertTrue(
            file_system.file_exists(
                Path('~/.texviper/config.json').expanduser()))
예제 #6
0
 def run(self):
     config.open_config()
     try:
         database.connect()
     except DatabaseConnectionError as db_err:
         raise db_err