Files
OctoPrint/tests/util/test_caseinsensitive_set.py

26 lines
669 B
Python

# coding=utf-8
from __future__ import absolute_import
__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.util
@ddt.ddt
class TestCaseInsensitiveSet(unittest.TestCase):
def setUp(self):
self.set = octoprint.util.CaseInsensitiveSet("A", "FoO", True, 23)
@ddt.data("A", "a", "foo", True, 23)
def test_contained(self, value):
self.assertTrue(value in self.set)
@ddt.data("b", "fnord", False, 42)
def test_not_contained(self, value):
self.assertFalse(value in self.set)