Files
OctoPrint/tests/util/test_caseinsensitive_set.py
T
tedder 250e83ad7e more specific asserts
This lets the testing framework show the test error better.
2018-09-01 22:32:47 -07:00

26 lines
663 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.assertIn(value, self.set)
@ddt.data("b", "fnord", False, 42)
def test_not_contained(self, value):
self.assertNotIn(value, self.set)