fixed spacing
parent
0563c91b33
commit
47dbed1229
|
|
@ -1,6 +1,7 @@
|
||||||
import pytest
|
import pytest
|
||||||
from piker.ui._style import DpiAwareFont
|
from piker.ui._style import DpiAwareFont
|
||||||
|
|
||||||
|
|
||||||
class MockScreen:
|
class MockScreen:
|
||||||
def __init__(self, pdpi, ldpi, name="MockScreen"):
|
def __init__(self, pdpi, ldpi, name="MockScreen"):
|
||||||
self._pdpi = pdpi
|
self._pdpi = pdpi
|
||||||
|
|
@ -8,13 +9,14 @@ class MockScreen:
|
||||||
self._name = name
|
self._name = name
|
||||||
|
|
||||||
def physicalDotsPerInch(self):
|
def physicalDotsPerInch(self):
|
||||||
return self._pdpi
|
return self._pdpi
|
||||||
|
|
||||||
def logicalDotsPerInch(self):
|
def logicalDotsPerInch(self):
|
||||||
return self._ldpi
|
return self._ldpi
|
||||||
|
|
||||||
def name(self):
|
def name(self):
|
||||||
return self._name
|
return self._name
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
"pdpi, ldpi, expected_px",
|
"pdpi, ldpi, expected_px",
|
||||||
|
|
@ -31,4 +33,4 @@ def test_font_px_size(pdpi, ldpi, expected_px):
|
||||||
px = font.px_size
|
px = font.px_size
|
||||||
print(f"{pdpi}x{ldpi} DPI -> Computed pixel size: {px}")
|
print(f"{pdpi}x{ldpi} DPI -> Computed pixel size: {px}")
|
||||||
|
|
||||||
assert px == expected_px
|
assert px == expected_px
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue