Test the view event.
(self)
| 429 | expandingbutton.clipboard_append.assert_called_with('TEXT') |
| 430 | |
| 431 | def test_view(self): |
| 432 | """Test the view event.""" |
| 433 | squeezer = self.make_mock_squeezer() |
| 434 | expandingbutton = ExpandingButton('TEXT', 'TAGS', 50, squeezer) |
| 435 | expandingbutton.selection_own = Mock() |
| 436 | |
| 437 | with patch('idlelib.squeezer.view_text', autospec=view_text)\ |
| 438 | as mock_view_text: |
| 439 | # Trigger the view event. |
| 440 | expandingbutton.view(event=Mock()) |
| 441 | |
| 442 | # Check that the expanding button called view_text. |
| 443 | self.assertEqual(mock_view_text.call_count, 1) |
| 444 | |
| 445 | # Check that the proper text was passed. |
| 446 | self.assertEqual(mock_view_text.call_args[0][2], 'TEXT') |
| 447 | |
| 448 | def test_rmenu(self): |
| 449 | """Test the context menu.""" |
nothing calls this directly
no test coverage detected