class TestConfigurationSerializer(TestCase): def setUp(self): self.config = StdmConfiguration.instance() self.serializer = ConfigurationFileSerializer(config_path) def tearDown(self): self.config = None def test_save(self): populate_configuration(self.config) self.serializer.save() update_result = True #Hardwire result self.assertTrue(update_result) def test_load(self): self.serializer.load() read_result = True #Hardwire result self.assertTrue(read_result)
def save_configuration(): """ A util method for saving the configuration instance to the default file location. """ config_path = QDesktopServices.storageLocation(QDesktopServices.HomeLocation) \ + '/.stdm/configuration.stc' conf_serializer = ConfigurationFileSerializer(config_path) conf_serializer.save()
def save_configuration(): """ A util method for saving the configuration instance to the default file location. """ config_path = QStandardPaths.standardLocations(QStandardPaths.HomeLocation)[0] \ + '/.stdm/configuration.stc' conf_serializer = ConfigurationFileSerializer(config_path) conf_serializer.save()
class TestConfigurationSerializer(TestCase): def setUp(self): self.config = StdmConfiguration.instance() self.serializer = ConfigurationFileSerializer(config_path) def tearDown(self): self.config = None def test_save(self): populate_configuration(self.config) self.serializer.save() update_result = True self.assertTrue(update_result) def test_load(self): self.serializer.load() read_result = True self.assertTrue(read_result)