mirror of
https://github.com/evennia/evennia.git
synced 2026-03-22 07:46:30 +01:00
Update unit tests for utils.latinify
This commit is contained in:
parent
8058e01e06
commit
bfca8c8552
1 changed files with 4 additions and 13 deletions
|
|
@ -229,23 +229,14 @@ class LatinifyTest(TestCase):
|
|||
def setUp(self):
|
||||
super().setUp()
|
||||
|
||||
self.example_str = 'It says, “plugh.”'
|
||||
self.example_ustr = u'It says, “plugh.”'
|
||||
|
||||
self.expected_output = 'It says, "plugh."'
|
||||
self.example_str = 'It naïvely says, “plugh.”'
|
||||
self.expected_output = 'It naively says, "plugh."'
|
||||
|
||||
def test_plain_string(self):
|
||||
result = utils.latinify(self.example_str)
|
||||
self.assertEqual(result, self.expected_output)
|
||||
|
||||
def test_unicode_string(self):
|
||||
result = utils.latinify(self.example_ustr)
|
||||
self.assertEqual(result, self.expected_output)
|
||||
|
||||
def test_encoded_string(self):
|
||||
result = utils.latinify(self.example_str.encode('utf8'))
|
||||
self.assertEqual(result, self.expected_output)
|
||||
|
||||
def test_byte_string(self):
|
||||
result = utils.latinify(utils.to_bytes(self.example_str))
|
||||
byte_str = utils.to_bytes(self.example_str)
|
||||
result = utils.latinify(byte_str)
|
||||
self.assertEqual(result, self.expected_output)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue