def test_display_windows_with_ansi(self, mock_print, mock_sys, mock_init, mock_deinit): mock_sys.platform = 'win32' display = Display() display.display_string = 'foobar' display.force_ansi = True display.display() mock_init.assert_not_called() mock_print.assert_called_once_with('foobar') mock_deinit.assert_called()
def test_display_non_windows(self, mock_print, mock_sys, mock_init, mock_deinit): mock_sys.platform = 'foobarbaz' display = Display() display.display_string = 'foobar' display.force_ansi = False display.display() mock_init.assert_not_called() mock_print.assert_called_once_with('foobar') mock_deinit.assert_called()