def test_get_float_invalid(self): with self.mocked_config(): settings = octoprint.settings.Settings() value = settings.getFloat(["server", "host"]) self.assertIsNone(value)
def test_get_float_converted(self): with self.mocked_config(): settings = octoprint.settings.Settings() value = settings.getFloat(["serial", "timeout", "connection"]) self.assertEqual(5.0, value)
def test_get_float_invalid(self): with self.settings() as settings: value = settings.getFloat(["server", "host"]) self.assertIsNone(value)
def test_get_float_converted(self): with self.settings() as settings: value = settings.getFloat(["serial", "timeout", "connection"]) self.assertEqual(5.0, value)