Example #1
0
 def test_remove_invalid(self, path):
     with self.settings() as settings:
         try:
             settings.remove(path, error_on_path=True)
             self.fail("Expected NoSuchSettingsPath")
         except octoprint.settings.NoSuchSettingsPath:
             pass
Example #2
0
	def test_remove_invalid(self, path):
		with self.mocked_config():
			settings = octoprint.settings.Settings()

			try:
				settings.remove(path, error_on_path=True)
				self.fail("Expected NoSuchSettingsPath")
			except octoprint.settings.NoSuchSettingsPath:
				pass
Example #3
0
    def test_remove(self):
        with self.mocked_config():
            settings = octoprint.settings.Settings()

            self.assertTrue("port" in settings._config["server"])

            settings.remove(["server", "port"])

            self.assertFalse("port" in settings._config["server"])
            self.assertEqual(5000, settings.get(["server", "port"]))
Example #4
0
    def test_remove(self):
        with self.settings() as settings:
            self.assertTrue("port" in settings._config["server"])

            settings.remove(["server", "port"])

            self.assertFalse(
                "server" in settings._config and "port" in settings._config["server"]
            )
            self.assertEqual(5000, settings.get(["server", "port"]))
Example #5
0
	def test_remove(self):
		with self.mocked_config():
			settings = octoprint.settings.Settings()

			self.assertTrue("port" in settings._config["server"])

			settings.remove(["server", "port"])

			self.assertFalse("port" in settings._config["server"])
			self.assertEqual(5000, settings.get(["server", "port"]))