Skip to content

Commit

Permalink
Remove "is Unicode" tests (#1014220)
Browse files Browse the repository at this point in the history
All strings are Unicode strings in Python, so remove
tests that check if a string is Unicode or not.
  • Loading branch information
M4rtinK committed Jun 1, 2015
1 parent cc6ef52 commit 776ba23
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions tests/pyanaconda_tests/iutil_test.py
Expand Up @@ -592,17 +592,9 @@ class O(object):
def strip_accents_test(self):
"""Test strip_accents."""

# string needs to be Unicode,
# otherwise TypeError is raised
with self.assertRaises(TypeError):
iutil.strip_accents("")
with self.assertRaises(TypeError):
iutil.strip_accents("abc")
with self.assertRaises(TypeError):
iutil.strip_accents("ěščřžýáíé")

# empty Unicode string
# empty string
self.assertEquals(iutil.strip_accents(u""), u"")
self.assertEquals(iutil.strip_accents(""), "")

# some Czech accents
self.assertEquals(iutil.strip_accents(u"ěščřžýáíéúů"), u"escrzyaieuu")
Expand Down Expand Up @@ -671,17 +663,6 @@ class O(object):
def to_ascii_test(self):
"""Test _toASCII."""

# works with strings only, chokes on Unicode strings
with self.assertRaises(ValueError):
iutil._toASCII(u" ")
with self.assertRaises(ValueError):
iutil._toASCII(u"ABC")
with self.assertRaises(ValueError):
iutil._toASCII(u"Heizölrückstoßabdämpfung")

# but empty Unicode string is fine :)
iutil._toASCII(u"")

# check some conversions
self.assertEqual(iutil._toASCII(""), "")
self.assertEqual(iutil._toASCII(" "), " ")
Expand Down

0 comments on commit 776ba23

Please sign in to comment.