mirror of
https://github.com/jtesta/ssh-audit.git
synced 2025-06-22 02:33:40 +02:00
Remove native text
converter (#38)
* Remove `native text` converter This was only necessary with Python 2. After Python 2 removal, both functions `to_ntext` and `to_utext` exactly did the same. modified: ssh-audit.py modified: test/test_utils.py * Rename `to_utext` to `to_text` ... as in Python 3 there is only text (and bytes). modified: ssh-audit.py modified: test/test_utils.py
This commit is contained in:
@ -14,19 +14,12 @@ class TestUtils:
|
||||
with pytest.raises(TypeError):
|
||||
self.utils.to_bytes(123)
|
||||
|
||||
def test_to_utext(self):
|
||||
assert self.utils.to_utext(b'fran\xc3\xa7ais') == 'fran\xe7ais'
|
||||
assert self.utils.to_utext('fran\xe7ais') == 'fran\xe7ais'
|
||||
def test_to_text(self):
|
||||
assert self.utils.to_text(b'fran\xc3\xa7ais') == 'fran\xe7ais'
|
||||
assert self.utils.to_text('fran\xe7ais') == 'fran\xe7ais'
|
||||
# other
|
||||
with pytest.raises(TypeError):
|
||||
self.utils.to_utext(123)
|
||||
|
||||
def test_to_ntext(self):
|
||||
assert self.utils.to_ntext('fran\xc3\xa7ais') == 'fran\xc3\xa7ais'
|
||||
assert self.utils.to_ntext(b'fran\xc3\xa7ais') == 'fran\xe7ais'
|
||||
# other
|
||||
with pytest.raises(TypeError):
|
||||
self.utils.to_ntext(123)
|
||||
self.utils.to_text(123)
|
||||
|
||||
def test_is_ascii(self):
|
||||
assert self.utils.is_ascii('francais') is True
|
||||
|
Reference in New Issue
Block a user