def test_set_boolean_convert_any_false(self, value): with self.mocked_config(): settings = octoprint.settings.Settings() settings.setBoolean(["api", "enabled"], value) self.assertEqual(False, settings._config["api"]["enabled"])
def test_set_boolean_convert_string_true(self, value): with self.mocked_config(): settings = octoprint.settings.Settings() settings.setBoolean(["devel", "virtualPrinter", "repetierStyleResends"], value) self.assertEqual(True, settings._config["devel"]["virtualPrinter"]["repetierStyleResends"])
def test_set_boolean(self): with self.mocked_config(): settings = octoprint.settings.Settings() settings.setBoolean(["devel", "virtualPrinter", "sendWait"], False) self.assertEqual(False, settings._config["devel"]["virtualPrinter"]["sendWait"])
def test_set_boolean_convert_any_false(self, value): with self.settings() as settings: settings.setBoolean(["api", "enabled"], value) self.assertEqual(False, settings._config["api"]["enabled"])
def test_set_boolean(self): with self.settings() as settings: settings.setBoolean(["devel", "virtualPrinter", "sendWait"], False) self.assertEqual( False, settings._config["devel"]["virtualPrinter"]["sendWait"] )