Adjust Pixel.__repr__()
a tiny bit
This commit is contained in:
parent
63e8e94145
commit
fd404e2b89
2 changed files with 3 additions and 3 deletions
|
@ -52,7 +52,7 @@ class Pixel(meta.Base):
|
||||||
|
|
||||||
def __repr__(self) -> str:
|
def __repr__(self) -> str:
|
||||||
"""Non-literal text representation."""
|
"""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,
|
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.southwest.latitude, self.southwest.longitude),
|
||||||
(self.northeast.latitude, self.northeast.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.
|
# Make the `Pixel`s look like a checkerboard.
|
||||||
if (self.n_x + self.n_y) % 2:
|
if (self.n_x + self.n_y) % 2:
|
||||||
|
|
|
@ -18,7 +18,7 @@ class TestSpecialMethods:
|
||||||
"""`Pixel` has a non-literal text representation."""
|
"""`Pixel` has a non-literal text representation."""
|
||||||
result = repr(pixel)
|
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
|
@pytest.mark.db
|
||||||
|
|
Loading…
Reference in a new issue