~roadmr/ubuntu/precise/checkbox/0.13.1

« back to all changes in this revision

Viewing changes to plugins/subunit_report.py

  • Committer: Bazaar Package Importer
  • Author(s): Marc Tardif
  • Date: 2009-01-20 18:55:20 UTC
  • Revision ID: james.westby@ubuntu.com-20090120185520-s18m2hninrt53fki
Tags: 0.5
* New upstream version:
  * Added concept of hyper text view to display clickable links.
  * Added concept of properties to components.
  * Added pci information to launchpad report.
  * Added dmi information to launchpad report.
  * Added text area to keyboard test.
  * Removed sourcing of base postrm script.
  * Updated translations from Launchpad.
* Fixed handling of interrupt signal (LP: #327810)
* Fixed display of text in graphical interface (LP: #240374)
* Fixed support for regexes in blacklist and whitelist (LP: #327177)
* Fixed opening of subunit log file (LP: #325737)
* Fixed internet test.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#
2
 
# Copyright (c) 2008 Canonical
3
 
#
4
 
# Written by Marc Tardif <marc@interunion.ca>
5
 
#
6
2
# This file is part of Checkbox.
7
3
#
 
4
# Copyright 2008 Canonical Ltd.
 
5
#
8
6
# Checkbox is free software: you can redistribute it and/or modify
9
7
# it under the terms of the GNU General Public License as published by
10
8
# the Free Software Foundation, either version 3 of the License, or
22
20
 
23
21
from checkbox.test import FAIL, PASS, SKIP
24
22
 
 
23
from checkbox.properties import String
25
24
from checkbox.plugin import Plugin
26
25
 
27
26
 
28
27
class SubunitReport(Plugin):
29
28
 
30
 
    required_attributes = ["filename"]
 
29
    # Filename where to store the subunit report
 
30
    filename = String(default="%(checkbox_data)s/subunit.log")
31
31
 
32
32
    result_status_table = {
33
33
        FAIL: "failure",
36
36
 
37
37
    def register(self, manager):
38
38
        super(SubunitReport, self).register(manager)
39
 
        logging.debug("Opening filename: %s", self._config.filename)
40
 
        self._file = open(self._config.filename, "w")
41
 
 
42
 
        self._manager.reactor.call_on("report-result", self.report_result)
 
39
        self._file = None
 
40
 
 
41
        for (rt, rh) in [
 
42
             ("gather", self.gather),
 
43
             ("report-result", self.report_result)]:
 
44
            self._manager.reactor.call_on(rt, rh)
 
45
 
 
46
    def gather(self):
 
47
        logging.debug("Opening filename: %s", self.filename)
 
48
        self._file = open(self.filename, "w")
43
49
 
44
50
    def report_result(self, result):
45
51
        # Test