[Reportbug-commits] [SCM] Reportbug - reports bugs in the Debian distribution branch, master, updated. 4.9-207-ge4c5fe7

Sandro Tosi morph at debian.org
Wed Aug 10 22:02:41 UTC 2011


The following commit has been merged in the master branch:
commit ddae195c7c59e2130e2eff7dcb740a63a5f5720c
Author: Sandro Tosi <morph at debian.org>
Date:   Wed Aug 10 21:59:24 2011 +0200

    added unit tests for gtk2 Bug() class

diff --git a/reportbug/ui/gtk2_ui.py b/reportbug/ui/gtk2_ui.py
index 13f6efb..315f415 100644
--- a/reportbug/ui/gtk2_ui.py
+++ b/reportbug/ui/gtk2_ui.py
@@ -208,6 +208,7 @@ class ReportViewerDialog (gtk.Dialog):
 # BTS
 
 class Bug (object):
+    """Encapsulate a bug report for the GTK+ UI"""
     def __init__ (self, bug):
         self.id = bug.bug_num
         self.tag = u', '.join(bug.tags)
diff --git a/test/test_ui_gtk2.py b/test/test_ui_gtk2.py
new file mode 100644
index 0000000..5a59f7e
--- /dev/null
+++ b/test/test_ui_gtk2.py
@@ -0,0 +1,29 @@
+""" Unit test for reportbug.ui.gtk2_ui module """
+
+import unittest2
+
+from nose.plugins.attrib import attr
+
+from reportbug import utils
+from reportbug.ui import gtk2_ui as ui
+import debianbts
+
+class TestUIGTK2(unittest2.TestCase):
+
+    @attr('network') #marking the test as using network
+    def test_bug_class(self):
+        bug = debianbts.get_status(415801)[0]
+
+        gtk_bug = ui.Bug(bug)
+
+        self.assertIsNotNone(gtk_bug)
+        self.assertEqual(bug.bug_num, gtk_bug.id)
+        self.assertEqual(bug.severity, gtk_bug.severity)
+        self.assertEqual(bug.package, gtk_bug.package)
+        self.assertEqual(bug.originator, gtk_bug.reporter)
+        self.assertEqual(bug.date, gtk_bug.date)
+        for tag in bug.tags:
+            self.assertIn(tag, gtk_bug.tag)
+
+        for item in gtk_bug:
+            self.assertIsNotNone(item)

-- 
Reportbug - reports bugs in the Debian distribution



More information about the Reportbug-commits mailing list