Skip to content

Commit

Permalink
Add clarifying comments, per review.
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyandrewmeyer committed Jul 9, 2024
1 parent 075bcaa commit 4b79027
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/test_e2e/test_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,16 @@ def test_status_comparison(status):
ops_status = ops.UnknownStatus()
else:
ops_status = getattr(ops, status.__class__.__name__)(status.message)
assert status == status == ops_status
# A status can be compared to itself.
assert status == status
# A status can be compared to another instance of the scenario class.
if isinstance(status, UnknownStatus):
assert status == status.__class__()
else:
assert status == status.__class__(status.message)
# A status can be compared to an instance of the ops class.
assert status == ops_status
# isinstance also works for comparing to the ops classes.
assert isinstance(status, type(ops_status))
# The repr of the scenario and ops classes should be identical.
assert repr(status) == repr(ops_status)

0 comments on commit 4b79027

Please sign in to comment.