Test status display when no organization owner exists.
(self, mock_console, mock_api_class)
| 346 | @patch("cli_output.status.codeplain_api.CodeplainAPI") |
| 347 | @patch("cli_output.status.console") |
| 348 | def test_no_organization_owner(self, mock_console, mock_api_class): |
| 349 | """Test status display when no organization owner exists.""" |
| 350 | mock_api = Mock() |
| 351 | mock_api_class.return_value = mock_api |
| 352 | mock_api.connection_check.return_value = { |
| 353 | "client_version_valid": True, |
| 354 | "min_client_version": "0.3.0", |
| 355 | } |
| 356 | mock_api.status.return_value = { |
| 357 | "user": { |
| 358 | "first_name": "John", |
| 359 | "last_name": "Doe", |
| 360 | "email": "john@example.com", |
| 361 | }, |
| 362 | "api_key_label": "test-key", |
| 363 | "organization_owner_email": None, |
| 364 | "plan_credits": None, |
| 365 | "purchased_credits": [], |
| 366 | } |
| 367 | |
| 368 | print_status("fake-key", "http://localhost:5000", "0.3.0") |
| 369 | |
| 370 | # Verify N/A is displayed for organization owner |
| 371 | calls = [str(call) for call in mock_console.print.call_args_list] |
| 372 | org_call = next((c for c in calls if "Organization owner" in c), None) |
| 373 | assert org_call is not None |
| 374 | assert "N/A" in org_call |
| 375 | |
| 376 | @patch("cli_output.status.codeplain_api.CodeplainAPI") |
| 377 | @patch("cli_output.status.console") |
nothing calls this directly
no test coverage detected