def test_convert_stringval(self): tests = ( (0, 0), ('09', 9), ('a', 'a'), ('áÚ', 'áÚ'), ([], '[]'), (None, 'None') ) for orig, expected in tests: self.failUnlessEqual(ttk._convert_stringval(orig), expected)
def test_convert_stringval(self): tests = ((0, 0), ("09", 9), ("a", "a"), (u"áÚ", u"áÚ"), ([], "[]"), (None, "None")) for orig, expected in tests: self.assertEqual(ttk._convert_stringval(orig), expected) if sys.getdefaultencoding() == "ascii": self.assertRaises(UnicodeDecodeError, ttk._convert_stringval, "á")
def test_convert_stringval(self): tests = ((0, 0), ('09', 9), ('a', 'a'), (u'áÚ', u'áÚ'), ([], '[]'), (None, 'None')) for orig, expected in tests: self.assertEqual(ttk._convert_stringval(orig), expected) if sys.getdefaultencoding() == 'ascii': self.assertRaises(UnicodeDecodeError, ttk._convert_stringval, 'á')
def test_convert_stringval(self): tests = ( (0, 0), ('09', 9), ('a', 'a'), (u'áÚ', u'áÚ'), ([], '[]'), (None, 'None') ) for orig, expected in tests: self.assertEqual(ttk._convert_stringval(orig), expected) if sys.getdefaultencoding() == 'ascii': self.assertRaises(UnicodeDecodeError, ttk._convert_stringval, 'á')