Back to index

apport  2.3
Public Member Functions | Public Attributes
test_ui_kde.T Class Reference

List of all members.

Public Member Functions

def setUpClass
def setUp
def tearDown
def test_close_button
def test_kernel_crash_layout
def test_package_crash_layout
def test_regular_crash_layout
def test_regular_crash_layout_restart
def test_system_crash_layout
def test_apport_bug_package_layout
def test_1_crash_nodetails
def test_1_crash_details
def test_1_crash_noaccept
def test_bug_report_installed_package
def test_bug_report_uninstalled_package
def test_1_update_report
def test_1_update_report_different_binary_source
def test_administrator_disabled_reporting

Public Attributes

 report_dir
 app
 hook_dir
 visible_progress

Detailed Description

Definition at line 38 of file test_ui_kde.py.


Member Function Documentation

def test_ui_kde.T.setUp (   self)

Definition at line 45 of file test_ui_kde.py.

00045 
00046     def setUp(self):
00047         self.report_dir = tempfile.mkdtemp()
00048         apport.fileutils.report_dir = self.report_dir
00049         os.environ['APPORT_REPORT_DIR'] = self.report_dir
00050         # do not cause eternal hangs because of error dialog boxes
00051         os.environ['APPORT_DISABLE_DISTRO_CHECK'] = '1'
00052 
00053         self.app = MainUserInterface()
00054 
00055         # use in-memory crashdb
00056         self.app.crashdb = apport.crashdb_impl.memory.CrashDatabase(None, {})
00057 
00058         # disable package hooks, as they might ask for sudo password and other
00059         # interactive bits; allow tests to install their own hooks
00060         self.hook_dir = tempfile.mkdtemp()
00061         apport.report._hook_dir = self.hook_dir
00062         apport.report._common_hook_dir = self.hook_dir
00063 
00064         # test report
00065         self.app.report_file = os.path.join(self.report_dir, 'bash.crash')
00066 
00067         self.app.report = apport.Report()
00068         self.app.report['ExecutablePath'] = '/bin/bash'
00069         self.app.report['Signal'] = '11'
00070         self.app.report['CoreDump'] = b'\x01\x02'
00071         with open(self.app.report_file, 'wb') as f:
00072             self.app.report.write(f)

def test_ui_kde.T.setUpClass (   klass)

Definition at line 40 of file test_ui_kde.py.

00040 
00041     def setUpClass(klass):
00042         r = apport.Report()
00043         r.add_os_info()
00044         klass.distro = r['DistroRelease']

def test_ui_kde.T.tearDown (   self)

Definition at line 73 of file test_ui_kde.py.

00073 
00074     def tearDown(self):
00075         if self.app.dialog:
00076             QCoreApplication.processEvents()
00077             self.app.dialog.done(0)
00078             QCoreApplication.processEvents()
00079 
00080         shutil.rmtree(self.report_dir)
00081         shutil.rmtree(self.hook_dir)

def test_ui_kde.T.test_1_crash_details (   self,
  args 
)
Crash report with showing details

Definition at line 322 of file test_ui_kde.py.

00322 
00323     def test_1_crash_details(self, *args):
00324         '''Crash report with showing details'''
00325 
00326         self.visible_progress = None
00327 
00328         def show_details(*args):
00329             if self.app.dialog and self.app.dialog.show_details.isVisible():
00330                 self.app.dialog.show_details.click()
00331                 QTimer.singleShot(1000, cont)
00332                 return
00333 
00334             # try again
00335             QTimer.singleShot(200, show_details)
00336 
00337         def cont(*args):
00338             # wait until data collection is done and tree filled
00339             details = self.app.dialog.findChild(QTreeWidget, 'details')
00340             if details.topLevelItemCount() == 0:
00341                 QTimer.singleShot(200, cont)
00342                 return
00343 
00344             if self.app.dialog and self.app.dialog.continue_button.isVisible():
00345                 self.app.dialog.continue_button.click()
00346                 QTimer.singleShot(500, check_progress)
00347                 return
00348             # try again
00349             QTimer.singleShot(200, cont)
00350 
00351         def check_progress(*args):
00352             self.visible_progress = (self.app.progress is not None)
00353 
00354         QTimer.singleShot(200, show_details)
00355         self.app.run_crash(self.app.report_file)
00356 
00357         # we should have reported one crash
00358         self.assertEqual(self.app.crashdb.latest_id(), 0)
00359         r = self.app.crashdb.download(0)
00360         self.assertEqual(r['ProblemType'], 'Crash')
00361         self.assertEqual(r['ExecutablePath'], '/bin/bash')
00362 
00363         # we already collected details, do not show the progress dialog again
00364         self.assertFalse(self.visible_progress)
00365 
00366         # data was collected
00367         self.assertTrue(r['Package'].startswith('bash '))
00368         self.assertTrue('libc' in r['Dependencies'])
00369         self.assertTrue('Stacktrace' in r)
00370 
00371         # URL was opened
00372         self.assertEqual(self.app.open_url.call_count, 1)

def test_ui_kde.T.test_1_crash_noaccept (   self,
  args 
)
Crash report with non-accepting crash DB

Definition at line 374 of file test_ui_kde.py.

00374 
00375     def test_1_crash_noaccept(self, *args):
00376         '''Crash report with non-accepting crash DB'''
00377 
00378         self.visible_progress = None
00379 
00380         def cont(*args):
00381             if self.app.dialog and self.app.dialog.continue_button.isVisible():
00382                 self.app.dialog.continue_button.click()
00383                 QTimer.singleShot(500, check_progress)
00384                 return
00385             # try again
00386             QTimer.singleShot(1000, cont)
00387 
00388         def check_progress(*args):
00389             self.visible_progress = (self.app.progress is not None)
00390 
00391         QTimer.singleShot(1000, cont)
00392         self.app.crashdb.options['problem_types'] = ['bug']
00393         self.app.run_crash(self.app.report_file)
00394 
00395         # we should not have reported the crash
00396         self.assertEqual(self.app.crashdb.latest_id(), -1)
00397         self.assertEqual(self.app.open_url.call_count, 0)
00398 
00399         # no progress dialog for non-accepting DB
00400         self.assertEqual(self.visible_progress, False)
00401 
00402         # data was collected for whoopsie
00403         r = self.app.report
00404         self.assertEqual(r['ProblemType'], 'Crash')
00405         self.assertEqual(r['ExecutablePath'], '/bin/bash')
00406         self.assertTrue(r['Package'].startswith('bash '))
00407         self.assertTrue('libc' in r['Dependencies'])
00408         self.assertTrue('Stacktrace' in r)

def test_ui_kde.T.test_1_crash_nodetails (   self,
  args 
)
Crash report without showing details

Definition at line 285 of file test_ui_kde.py.

00285 
00286     def test_1_crash_nodetails(self, *args):
00287         '''Crash report without showing details'''
00288 
00289         self.visible_progress = None
00290 
00291         def cont(*args):
00292             if self.app.dialog and self.app.dialog.continue_button.isVisible():
00293                 self.app.dialog.continue_button.click()
00294                 QTimer.singleShot(500, check_progress)
00295                 return
00296             # try again
00297             QTimer.singleShot(1000, cont)
00298 
00299         def check_progress(*args):
00300             self.visible_progress = (self.app.progress is not None)
00301 
00302         QTimer.singleShot(1000, cont)
00303         self.app.run_crash(self.app.report_file)
00304 
00305         # we should have reported one crash
00306         self.assertEqual(self.app.crashdb.latest_id(), 0)
00307         r = self.app.crashdb.download(0)
00308         self.assertEqual(r['ProblemType'], 'Crash')
00309         self.assertEqual(r['ExecutablePath'], '/bin/bash')
00310 
00311         # should show a progress bar for info collection
00312         self.assertEqual(self.visible_progress, True)
00313 
00314         # data was collected
00315         self.assertTrue(r['Package'].startswith('bash '))
00316         self.assertTrue('libc' in r['Dependencies'])
00317         self.assertTrue('Stacktrace' in r)
00318 
00319         # URL was opened
00320         self.assertEqual(self.app.open_url.call_count, 1)

def test_ui_kde.T.test_1_update_report (   self,
  args 
)
Updating an existing report

Definition at line 454 of file test_ui_kde.py.

00454 
00455     def test_1_update_report(self, *args):
00456         '''Updating an existing report'''
00457 
00458         self.app.report_file = None
00459 
00460         def cont(*args):
00461             if self.app.dialog and self.app.dialog.continue_button.isVisible():
00462                 self.app.dialog.continue_button.click()
00463                 return
00464             # try again
00465             QTimer.singleShot(200, cont)
00466 
00467         # upload empty report
00468         id = self.app.crashdb.upload({})
00469         self.assertEqual(id, 0)
00470         self.app.options.update_report = 0
00471         self.app.options.package = 'bash'
00472 
00473         QTimer.singleShot(200, cont)
00474         self.app.run_update_report()
00475 
00476         # no new bug reported
00477         self.assertEqual(self.app.crashdb.latest_id(), 0)
00478 
00479         # bug was updated
00480         r = self.app.crashdb.download(0)
00481         self.assertTrue(r['Package'].startswith('bash '))
00482         self.assertTrue('libc' in r['Dependencies'])
00483         self.assertTrue('DistroRelease' in r)
00484 
00485         # No URL in this mode
00486         self.assertEqual(self.app.open_url.call_count, 0)

Updating an existing report on a source package which does not have a binary of the same name

Definition at line 488 of file test_ui_kde.py.

00488 
00489     def test_1_update_report_different_binary_source(self, *args):
00490         '''Updating an existing report on a source package which does not have a binary of the same name'''
00491 
00492         self.app.report_file = None
00493 
00494         def cont(*args):
00495             if self.app.dialog and self.app.dialog.continue_button.isVisible():
00496                 self.app.dialog.continue_button.click()
00497                 return
00498             # try again
00499             QTimer.singleShot(200, cont)
00500 
00501         kernel_pkg = apport.packaging.get_kernel_package()
00502         kernel_src = apport.packaging.get_source(kernel_pkg)
00503         self.assertNotEqual(kernel_pkg, kernel_src,
00504                             'this test assumes that the kernel binary package != kernel source package')
00505         self.assertNotEqual(apport.packaging.get_version(kernel_pkg), '',
00506                             'this test assumes that the kernel binary package %s is installed' % kernel_pkg)
00507         # this test assumes that the kernel source package name is not an
00508         # installed binary package
00509         self.assertRaises(ValueError, apport.packaging.get_version, kernel_src)
00510 
00511         # create source package hook, as otherwise there is nothing to collect
00512         with open(os.path.join(self.hook_dir, 'source_%s.py' % kernel_src), 'w') as f:
00513             f.write('def add_info(r, ui):\n r["MachineType"]="Laptop"\n')
00514 
00515         # upload empty report
00516         id = self.app.crashdb.upload({})
00517         self.assertEqual(id, 0)
00518 
00519         # run in update mode for that bug
00520         self.app.options.update_report = 0
00521         self.app.options.package = kernel_src
00522 
00523         QTimer.singleShot(200, cont)
00524         self.app.run_update_report()
00525 
00526         # no new bug reported
00527         self.assertEqual(self.app.crashdb.latest_id(), 0)
00528 
00529         # bug was updated
00530         r = self.app.crashdb.download(0)
00531         self.assertTrue('ProcEnviron' in r)
00532         self.assertTrue('DistroRelease' in r)
00533         self.assertTrue('Uname' in r)
00534         self.assertEqual(r['MachineType'], 'Laptop')
00535 
00536         # No URL in this mode
00537         self.assertEqual(self.app.open_url.call_count, 0)

Definition at line 538 of file test_ui_kde.py.

00538 
00539     def test_administrator_disabled_reporting(self):
00540         QTimer.singleShot(0, QCoreApplication.quit)
00541         self.app.ui_present_report_details(False)
00542         self.assertFalse(self.app.dialog.send_error_report.isVisible())
00543         self.assertFalse(self.app.dialog.send_error_report.isChecked())

+-------------------------------------------------------------------+
| [ error  ] Send problem report to the developers?                 |
|                                                                   |
|            +----------------------------------------------------+ |
|            | |> ApportVersion                                   | |
|            | ...                                                | |
|            +----------------------------------------------------+ |
|                                                                   |
| [ Cancel ]                                               [ Send ] |
+-------------------------------------------------------------------+

Definition at line 255 of file test_ui_kde.py.

00255 
00256     def test_apport_bug_package_layout(self):
00257         '''
00258         +-------------------------------------------------------------------+
00259         | [ error  ] Send problem report to the developers?                 |
00260         |                                                                   |
00261         |            +----------------------------------------------------+ |
00262         |            | |> ApportVersion                                   | |
00263         |            | ...                                                | |
00264         |            +----------------------------------------------------+ |
00265         |                                                                   |
00266         | [ Cancel ]                                               [ Send ] |
00267         +-------------------------------------------------------------------+
00268         '''
00269         self.app.report_file = None
00270         QTimer.singleShot(0, QCoreApplication.quit)
00271         self.app.ui_present_report_details(True)
00272         self.assertEqual(self.app.dialog.windowTitle(), self.distro.split()[0])
00273         self.assertEqual(self.app.dialog.heading.text(),
00274                          _('Send problem report to the developers?'))
00275         self.assertFalse(self.app.dialog.text.isVisible())
00276         self.assertFalse(self.app.dialog.send_error_report.isVisible())
00277         self.assertTrue(self.app.dialog.send_error_report.isChecked())
00278         self.assertFalse(self.app.dialog.details.isVisible())
00279         self.assertTrue(self.app.dialog.continue_button.isVisible())
00280         self.assertEqual(self.app.dialog.continue_button.text(), _('Send'))
00281         self.assertFalse(self.app.dialog.closed_button.isVisible())
00282         self.assertTrue(self.app.dialog.cancel_button.isVisible())
00283         self.assertTrue(self.app.dialog.treeview.isVisible())

Bug report for installed package

Definition at line 409 of file test_ui_kde.py.

00409 
00410     def test_bug_report_installed_package(self):
00411         '''Bug report for installed package'''
00412 
00413         self.app.report_file = None
00414         self.app.options.package = 'bash'
00415 
00416         def c(*args):
00417             if self.app.dialog and self.app.dialog.cancel_button.isVisible():
00418                 self.app.dialog.cancel_button.click()
00419                 return
00420             # try again
00421             QTimer.singleShot(1000, c)
00422 
00423         QTimer.singleShot(1000, c)
00424         self.app.run_report_bug()
00425 
00426         self.assertEqual(self.app.report['ProblemType'], 'Bug')
00427         self.assertEqual(self.app.report['SourcePackage'], 'bash')
00428         self.assertTrue(self.app.report['Package'].startswith('bash '))
00429         self.assertNotEqual(self.app.report['Dependencies'], '')

Bug report for uninstalled package

Definition at line 430 of file test_ui_kde.py.

00430 
00431     def test_bug_report_uninstalled_package(self):
00432         '''Bug report for uninstalled package'''
00433 
00434         pkg = apport.packaging.get_uninstalled_package()
00435 
00436         self.app.report_file = None
00437         self.app.options.package = pkg
00438 
00439         def c(*args):
00440             if self.app.dialog and self.app.dialog.cancel_button.isVisible():
00441                 self.app.dialog.cancel_button.click()
00442                 return
00443             # try again
00444             QTimer.singleShot(1000, c)
00445 
00446         QTimer.singleShot(1000, c)
00447         self.app.run_report_bug()
00448 
00449         self.assertEqual(self.app.report['ProblemType'], 'Bug')
00450         self.assertEqual(self.app.report['SourcePackage'],
00451                          apport.packaging.get_source(pkg))
00452         self.assertEqual(self.app.report['Package'], '%s (not installed)' % pkg)

Clicking the close button on the window does not report the crash.

Definition at line 82 of file test_ui_kde.py.

00082 
00083     def test_close_button(self):
00084         '''Clicking the close button on the window does not report the crash.'''
00085 
00086         def c(*args):
00087             self.app.dialog.reject()
00088         QTimer.singleShot(0, c)
00089         result = self.app.ui_present_report_details(True)
00090         self.assertFalse(result['report'])

+-----------------------------------------------------------------+
| [ logo ] YourDistro has experienced an internal error.          |
|                                                                 |
|            [x] Send an error report to help fix this problem.   |
|                                                                 |
| [ Show Details ]                                   [ Continue ] |
+-----------------------------------------------------------------+

Definition at line 91 of file test_ui_kde.py.

00091 
00092     def test_kernel_crash_layout(self):
00093         '''
00094         +-----------------------------------------------------------------+
00095         | [ logo ] YourDistro has experienced an internal error.          |
00096         |                                                                 |
00097         |            [x] Send an error report to help fix this problem.   |
00098         |                                                                 |
00099         | [ Show Details ]                                   [ Continue ] |
00100         +-----------------------------------------------------------------+
00101         '''
00102         self.app.report['ProblemType'] = 'KernelCrash'
00103         QTimer.singleShot(0, QCoreApplication.quit)
00104         self.app.ui_present_report_details(True)
00105         self.assertEqual(self.app.dialog.windowTitle(), self.distro.split()[0])
00106         self.assertEqual(self.app.dialog.heading.text(),
00107                          _('Sorry, %s has experienced an internal error.') % self.distro)
00108         self.assertTrue(self.app.dialog.send_error_report.isVisible())
00109         self.assertTrue(self.app.dialog.send_error_report.isChecked())
00110         self.assertTrue(self.app.dialog.details.isVisible())
00111         self.assertTrue(self.app.dialog.continue_button.isVisible())
00112         self.assertEqual(self.app.dialog.continue_button.text(), _('Continue'))
00113         self.assertFalse(self.app.dialog.closed_button.isVisible())
00114         self.assertFalse(self.app.dialog.text.isVisible())

+-----------------------------------------------------------------+
| [ error  ] Sorry, a problem occurred while installing software. |
|            Package: apport 1.2.3~0ubuntu1                       |
|                                                                 |
|            [x] Send an error report to help fix this problem.   |
|                                                                 |
| [ Show Details ]                                   [ Continue ] |
+-----------------------------------------------------------------+

Definition at line 115 of file test_ui_kde.py.

00115 
00116     def test_package_crash_layout(self):
00117         '''
00118         +-----------------------------------------------------------------+
00119         | [ error  ] Sorry, a problem occurred while installing software. |
00120         |            Package: apport 1.2.3~0ubuntu1                       |
00121         |                                                                 |
00122         |            [x] Send an error report to help fix this problem.   |
00123         |                                                                 |
00124         | [ Show Details ]                                   [ Continue ] |
00125         +-----------------------------------------------------------------+
00126         '''
00127         self.app.report['ProblemType'] = 'Package'
00128         self.app.report['Package'] = 'apport 1.2.3~0ubuntu1'
00129         QTimer.singleShot(0, QCoreApplication.quit)
00130         self.app.ui_present_report_details(True)
00131         self.assertEqual(self.app.dialog.windowTitle(), self.distro.split()[0])
00132         self.assertEqual(self.app.dialog.heading.text(),
00133                          _('Sorry, a problem occurred while installing software.'))
00134         self.assertTrue(self.app.dialog.send_error_report.isVisible())
00135         self.assertTrue(self.app.dialog.send_error_report.isChecked())
00136         self.assertTrue(self.app.dialog.details.isVisible())
00137         self.assertTrue(self.app.dialog.continue_button.isVisible())
00138         self.assertEqual(self.app.dialog.continue_button.text(), _('Continue'))
00139         self.assertFalse(self.app.dialog.closed_button.isVisible())
00140         self.assertEqual(self.app.dialog.text.text(),
00141                          _('Package: apport 1.2.3~0ubuntu1'))

+-----------------------------------------------------------------+
| [ apport ] The application Apport has closed unexpectedly.      |
|                                                                 |
|            [x] Send an error report to help fix this problem.   |
|            [ ] Ignore future problems of this program version.  |
|                                                                 |
| [ Show Details ]                                   [ Continue ] |
+-----------------------------------------------------------------+

Definition at line 142 of file test_ui_kde.py.

00142 
00143     def test_regular_crash_layout(self):
00144         '''
00145         +-----------------------------------------------------------------+
00146         | [ apport ] The application Apport has closed unexpectedly.      |
00147         |                                                                 |
00148         |            [x] Send an error report to help fix this problem.   |
00149         |            [ ] Ignore future problems of this program version.  |
00150         |                                                                 |
00151         | [ Show Details ]                                   [ Continue ] |
00152         +-----------------------------------------------------------------+
00153         '''
00154         self.app.report['ProblemType'] = 'Crash'
00155         self.app.report['CrashCounter'] = '1'
00156         self.app.report['Package'] = 'apport 1.2.3~0ubuntu1'
00157         with tempfile.NamedTemporaryFile() as fp:
00158             fp.write(b'''[Desktop Entry]
00159 Version=1.0
00160 Name=Apport
00161 Type=Application''')
00162             fp.flush()
00163             self.app.report['DesktopFile'] = fp.name
00164             QTimer.singleShot(0, QCoreApplication.quit)
00165             self.app.ui_present_report_details(True)
00166         self.assertEqual(self.app.dialog.windowTitle(), self.distro.split()[0])
00167         self.assertEqual(self.app.dialog.heading.text(),
00168                          _('The application Apport has closed unexpectedly.'))
00169         self.assertTrue(self.app.dialog.send_error_report.isVisible())
00170         self.assertTrue(self.app.dialog.send_error_report.isChecked())
00171         self.assertTrue(self.app.dialog.details.isVisible())
00172         # no ProcCmdline, cannot restart
00173         self.assertTrue(self.app.dialog.continue_button.isVisible())
00174         self.assertEqual(self.app.dialog.continue_button.text(), _('Continue'))
00175         self.assertFalse(self.app.dialog.closed_button.isVisible())
00176         self.assertFalse(self.app.dialog.text.isVisible())
00177         self.assertFalse(self.app.dialog.text.isVisible())
00178         self.assertTrue(self.app.dialog.ignore_future_problems.isVisible())
00179         self.assertTrue(str(self.app.dialog.ignore_future_problems.text()).endswith(
00180             'of this program version'))

+-----------------------------------------------------------------+
| [ apport ] The application Apport has closed unexpectedly.      |
|                                                                 |
|            [x] Send an error report to help fix this problem.   |
|            [ ] Ignore future problems of this program version.  |
|                                                                 |
| [ Show Details ]                 [ Leave Closed ]  [ Relaunch ] |
+-----------------------------------------------------------------+

Definition at line 181 of file test_ui_kde.py.

00181 
00182     def test_regular_crash_layout_restart(self):
00183         '''
00184         +-----------------------------------------------------------------+
00185         | [ apport ] The application Apport has closed unexpectedly.      |
00186         |                                                                 |
00187         |            [x] Send an error report to help fix this problem.   |
00188         |            [ ] Ignore future problems of this program version.  |
00189         |                                                                 |
00190         | [ Show Details ]                 [ Leave Closed ]  [ Relaunch ] |
00191         +-----------------------------------------------------------------+
00192         '''
00193         self.app.report['ProblemType'] = 'Crash'
00194         self.app.report['CrashCounter'] = '1'
00195         self.app.report['ProcCmdline'] = 'apport-bug apport'
00196         self.app.report['Package'] = 'apport 1.2.3~0ubuntu1'
00197         with tempfile.NamedTemporaryFile() as fp:
00198             fp.write(b'''[Desktop Entry]
00199 Version=1.0
00200 Name=Apport
00201 Type=Application''')
00202             fp.flush()
00203             self.app.report['DesktopFile'] = fp.name
00204             QTimer.singleShot(0, QCoreApplication.quit)
00205             self.app.ui_present_report_details(True)
00206         self.assertEqual(self.app.dialog.windowTitle(),
00207                          self.distro.split()[0])
00208         self.assertEqual(self.app.dialog.heading.text(),
00209                          _('The application Apport has closed unexpectedly.'))
00210         self.assertTrue(self.app.dialog.send_error_report.isVisible())
00211         self.assertTrue(self.app.dialog.send_error_report.isChecked())
00212         self.assertTrue(self.app.dialog.details.isVisible())
00213         self.assertTrue(self.app.dialog.continue_button.isVisible())
00214         self.assertEqual(self.app.dialog.continue_button.text(), _('Relaunch'))
00215         self.assertTrue(self.app.dialog.closed_button.isVisible())
00216         self.assertFalse(self.app.dialog.text.isVisible())
00217         self.assertFalse(self.app.dialog.text.isVisible())
00218         self.assertTrue(self.app.dialog.ignore_future_problems.isVisible())
00219         self.assertTrue(str(self.app.dialog.ignore_future_problems.text()).endswith(
00220             'of this program version'))

+-----------------------------------------------------------------+
| [ logo ] Sorry, YourDistro has experienced an internal error.   |
|            If you notice further problems, try restarting the   |
|            computer                                             |
|                                                                 |
|            [x] Send an error report to help fix this problem.   |
|            [ ] Ignore future problems of this type.             |
|                                                                 |
| [ Show Details ]                                   [ Continue ] |
+-----------------------------------------------------------------+

Definition at line 221 of file test_ui_kde.py.

00221 
00222     def test_system_crash_layout(self):
00223         '''
00224         +-----------------------------------------------------------------+
00225         | [ logo ] Sorry, YourDistro has experienced an internal error.   |
00226         |            If you notice further problems, try restarting the   |
00227         |            computer                                             |
00228         |                                                                 |
00229         |            [x] Send an error report to help fix this problem.   |
00230         |            [ ] Ignore future problems of this type.             |
00231         |                                                                 |
00232         | [ Show Details ]                                   [ Continue ] |
00233         +-----------------------------------------------------------------+
00234         '''
00235         self.app.report['ProblemType'] = 'Crash'
00236         self.app.report['CrashCounter'] = '1'
00237         self.app.report['Package'] = 'apport 1.2.3~0ubuntu1'
00238         QTimer.singleShot(0, QCoreApplication.quit)
00239         self.app.ui_present_report_details(True)
00240         self.assertEqual(self.app.dialog.windowTitle(), self.distro.split()[0])
00241         self.assertEqual(self.app.dialog.heading.text(),
00242                          _('Sorry, %s has experienced an internal error.') % self.distro)
00243         self.assertEqual(self.app.dialog.text.text(),
00244                          _('If you notice further problems, try restarting the computer.'))
00245         self.assertTrue(self.app.dialog.text.isVisible())
00246         self.assertTrue(self.app.dialog.send_error_report.isVisible())
00247         self.assertTrue(self.app.dialog.send_error_report.isChecked())
00248         self.assertTrue(self.app.dialog.details.isVisible())
00249         self.assertTrue(self.app.dialog.continue_button.isVisible())
00250         self.assertEqual(self.app.dialog.continue_button.text(), _('Continue'))
00251         self.assertFalse(self.app.dialog.closed_button.isVisible())
00252         self.assertTrue(self.app.dialog.ignore_future_problems.isVisible())
00253         self.assertTrue(str(self.app.dialog.ignore_future_problems.text()).endswith(
00254             'of this type'))


Member Data Documentation

Definition at line 52 of file test_ui_kde.py.

Definition at line 59 of file test_ui_kde.py.

Definition at line 46 of file test_ui_kde.py.

Definition at line 288 of file test_ui_kde.py.


The documentation for this class was generated from the following file: