Adjust Pixel.__repr__() a tiny bit

This commit is contained in:
Alexander Hess 2021-01-31 19:34:05 +01:00
parent 63e8e94145
commit fd404e2b89
Signed by: alexander
GPG key ID: 344EA5AB10D868E0
2 changed files with 3 additions and 3 deletions

View file

@ -52,7 +52,7 @@ class Pixel(meta.Base):
def __repr__(self) -> str:
"""Non-literal text representation."""
return '<{cls}: ({x}, {y})>'.format(
return '<{cls}: ({x}|{y})>'.format(
cls=self.__class__.__name__, x=self.n_x, y=self.n_y,
)
@ -159,7 +159,7 @@ class Pixel(meta.Base):
(self.southwest.latitude, self.southwest.longitude),
(self.northeast.latitude, self.northeast.longitude),
)
info_text = f'Pixel({self.n_x}, {self.n_y})'
info_text = f'Pixel({self.n_x}|{self.n_y})'
# Make the `Pixel`s look like a checkerboard.
if (self.n_x + self.n_y) % 2:

View file

@ -18,7 +18,7 @@ class TestSpecialMethods:
"""`Pixel` has a non-literal text representation."""
result = repr(pixel)
assert result == f'<Pixel: ({pixel.n_x}, {pixel.n_y})>'
assert result == f'<Pixel: ({pixel.n_x}|{pixel.n_y})>'
@pytest.mark.db