Exemplo n.º 1
0
    def test_get_int_converted(self):
        with self.mocked_config():
            settings = octoprint.settings.Settings()

            value = settings.getInt(["serial", "timeout", "connection"])

            self.assertEqual(5, value)
Exemplo n.º 2
0
    def test_get_int_invalid(self):
        with self.mocked_config():
            settings = octoprint.settings.Settings()

            value = settings.getInt(["server", "host"])

            self.assertIsNone(value)
Exemplo n.º 3
0
	def test_get_custom_config(self):
		with self.mocked_config():
			settings = octoprint.settings.Settings()

			server_port = settings.getInt(["server", "port"], config=dict(server=dict(port=9090)))

			self.assertEqual(9090, server_port)
Exemplo n.º 4
0
    def test_get_custom_config(self):
        with self.settings() as settings:
            server_port = settings.getInt(
                ["server", "port"], config={"server": {"port": 9090}}
            )

            self.assertEqual(9090, server_port)
Exemplo n.º 5
0
	def test_get_int_invalid(self):
		with self.mocked_config():
			settings = octoprint.settings.Settings()

			value = settings.getInt(["server", "host"])

			self.assertIsNone(value)
Exemplo n.º 6
0
	def test_get_int_converted(self):
		with self.mocked_config():
			settings = octoprint.settings.Settings()

			value = settings.getInt(["serial", "timeout", "connection"])

			self.assertEqual(5, value)
Exemplo n.º 7
0
	def test_get_custom_config(self):
		with self.mocked_config():
			settings = octoprint.settings.Settings()

			server_port = settings.getInt(["server", "port"], config=dict(server=dict(port=9090)))

			self.assertEqual(9090, server_port)
Exemplo n.º 8
0
 def test_get_int_invalid(self):
     with self.settings() as settings:
         value = settings.getInt(["server", "host"])
         self.assertIsNone(value)
Exemplo n.º 9
0
 def test_get_int_converted(self):
     with self.settings() as settings:
         value = settings.getInt(["serial", "timeout", "connection"])
         self.assertEqual(5, value)