1
0
mirror of https://github.com/python-escpos/python-escpos synced 2025-08-24 09:03:34 +00:00

improve doc, improve codepage_tables.py

This commit is contained in:
Patrick Kanzler
2017-01-29 23:36:33 +01:00
parent e904500312
commit e4a21e94fc
4 changed files with 30 additions and 8 deletions

View File

@@ -24,6 +24,9 @@ from escpos.exceptions import CharCodeError, Error
class TestEncoder:
"""
Tests the single encoders.
"""
def test_can_encode(self):
assert not Encoder({'CP437': 1}).can_encode('CP437', u'')
@@ -40,10 +43,21 @@ class TestEncoder:
class TestMagicEncode:
"""
Tests the magic encode functionality.
"""
class TestInit:
"""
Test initialization.
"""
def test_disabled_requires_encoding(self, driver):
"""
Test that disabled without encoder raises an error.
:param driver:
"""
with pytest.raises(Error):
MagicEncode(driver, disabled=True)