Add Forecast.__repr__()
This commit is contained in:
parent
47ef1f8759
commit
1d63623dfc
2 changed files with 19 additions and 0 deletions
|
|
@ -34,6 +34,15 @@ class TestSpecialMethods:
|
|||
"""Test instantiation of a new `Forecast` object."""
|
||||
assert forecast is not None
|
||||
|
||||
def test_text_representation(self, forecast):
|
||||
"""`Forecast` has a non-literal text representation."""
|
||||
result = repr(forecast)
|
||||
|
||||
assert (
|
||||
result
|
||||
== f'<Forecast: {forecast.prediction} for pixel ({forecast.pixel.n_x}|{forecast.pixel.n_y}) at {forecast.start_at}>' # noqa:E501
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.db
|
||||
@pytest.mark.no_cover
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue