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')
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)
def setUpClass(cls): config.open_config(use_default=True)
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)
def test_config_is_created(self): config.open_config() self.assertTrue( file_system.file_exists( Path('~/.texviper/config.json').expanduser()))
def run(self): config.open_config() try: database.connect() except DatabaseConnectionError as db_err: raise db_err