Files
OctoPrint/tests/test_settings.py
T
Gina Häußge 7fb9df9940 ♻️ Migrate code base to Python 3 only
* pyupgrade
  * various new codemods
  * manual removal of Py2/3 compat imports
  * manual adjustment of docs, examples, tests
  * to_str is now the new to_unicode, deprecated
    redirection to to_bytes has been removed
  * to_native_str has been redirected to point to
    to_str
  * to_unicode has been redirected to point to
    to_str
  * atomic_write refactored to use
    NamedTemporaryDirectory
  * various other fixes/refactorings all over the
    place
2022-02-01 12:57:01 +01:00

32 lines
802 B
Python

__license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2018 The OctoPrint Project - Released under terms of the AGPLv3 License"
import unittest
import ddt
import octoprint.settings
@ddt.ddt
class TestHelpers(unittest.TestCase):
@ddt.data(
(True, True),
("true", True),
("True", True),
("tRuE", True),
("yes", True),
("YES", True),
("y", True),
("Y", True),
("1", True),
(1, True),
(False, False),
("Truuuuuuuuue", False),
("Nope", False),
(None, False),
)
@ddt.unpack
def test_valid_boolean_trues(self, value, expected):
self.assertEqual(expected, value in octoprint.settings.valid_boolean_trues)