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

reformat codebase

This commit is contained in:
Patrick Kanzler
2021-10-30 18:15:22 +02:00
parent 109a5d8a92
commit 435f2bba24
41 changed files with 1706 additions and 1398 deletions

View File

@@ -4,35 +4,33 @@ from escpos.capabilities import get_profile, NotSupported, BARCODE_B, Profile
@pytest.fixture
def profile():
return get_profile('default')
return get_profile("default")
class TestBaseProfile:
"""Test the `BaseProfile` class.
"""
"""Test the `BaseProfile` class."""
def test_get_font(self, profile):
with pytest.raises(NotSupported):
assert profile.get_font('3')
assert profile.get_font("3")
assert profile.get_font(1) == 1
assert profile.get_font('a') == 0
assert profile.get_font("a") == 0
def test_supports(self, profile):
assert not profile.supports('asdf asdf')
assert not profile.supports("asdf asdf")
assert profile.supports(BARCODE_B)
def test_get_columns(self, profile):
assert profile.get_columns('a') > 5
assert profile.get_columns("a") > 5
with pytest.raises(NotSupported):
assert profile.get_columns('asdfasdf')
assert profile.get_columns("asdfasdf")
class TestCustomProfile:
"""Test custom profile options with the `Profile` class.
"""
"""Test custom profile options with the `Profile` class."""
def test_columns(self):
assert Profile(columns=10).get_columns('sdfasdf') == 10
assert Profile(columns=10).get_columns("sdfasdf") == 10
def test_features(self):
assert Profile(features={'foo': True}).supports('foo')
assert Profile(features={"foo": True}).supports("foo")