Skip to content

Commit 65813da

Browse files
committed
fix the status tests left behind by the out-of-credits message
#314 made the status message print a line for every user: an upgrade notice when no credits remain, and a link to manage the plan when credits remain. Three tests still expected nothing to be printed when credits are active, so they fail. main has been red since that merge. CI does not run on a push to main, so the failure only appears on pull requests, which test the merge with main. The three tests now expect the manage-plan line and no upgrade notice.
1 parent 8fdb778 commit 65813da

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

‎tests/test_cli_output.py‎

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,10 @@ def test_has_active_plan_credits(self, mock_console):
216216
}
217217
_display_status_message(plan_credits, [], [])
218218

219-
# Should not print warning message
220-
mock_console.print.assert_not_called()
219+
mock_console.print.assert_called_once()
220+
call_args = mock_console.print.call_args[0][0]
221+
assert "To manage your plan" in call_args
222+
assert "No rendering credits remaining" not in call_args
221223

222224
@patch("cli_output.status.console")
223225
def test_has_active_purchased_credits(self, mock_console):
@@ -230,8 +232,10 @@ def test_has_active_purchased_credits(self, mock_console):
230232
]
231233
_display_status_message(None, purchased_credits, [])
232234

233-
# Should not print warning message
234-
mock_console.print.assert_not_called()
235+
mock_console.print.assert_called_once()
236+
call_args = mock_console.print.call_args[0][0]
237+
assert "To manage your plan" in call_args
238+
assert "No rendering credits remaining" not in call_args
235239

236240
@patch("cli_output.status.console")
237241
def test_has_active_promo_credits(self, mock_console):
@@ -244,8 +248,10 @@ def test_has_active_promo_credits(self, mock_console):
244248
]
245249
_display_status_message(None, [], promo_credits)
246250

247-
# Should not print warning message
248-
mock_console.print.assert_not_called()
251+
mock_console.print.assert_called_once()
252+
call_args = mock_console.print.call_args[0][0]
253+
assert "To manage your plan" in call_args
254+
assert "No rendering credits remaining" not in call_args
249255

250256
@patch("cli_output.status.console")
251257
def test_no_credits_remaining(self, mock_console):

0 commit comments

Comments
 (0)