File: test_reportbug_ui_urwid.py

package info (click to toggle)
reportbug 4.12.6%2Bdeb6u1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze-lts
  • size: 804 kB
  • ctags: 708
  • sloc: python: 7,789; makefile: 78; sh: 32; lisp: 31
file content (47 lines) | stat: -rw-r--r-- 1,691 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# -*- coding: utf-8; -*-

# test/test_reportbug_ui_urwid.py
# Part of reportbug, a Debian bug reporting tool.
#
# Copyright © 2008 Ben Finney <ben+python@benfinney.id.au>
# This is free software; you may copy, modify and/or distribute this work
# under the terms of the GNU General Public License, version 2 or later.
# No warranty expressed or implied. See the file LICENSE for details.

""" Unit test for reportbuglib.reportbug_ui_urwid module
"""

import scaffold
from scaffold import TestCase

from reportbug.ui import urwid_ui as reportbug_ui_urwid
from reportbug.ui import text_ui as reportbug_ui_text


class Test_ewrite(TestCase):
    """ Test cases for 'ewrite' """

    def test_is_expected_object(self):
        """ Module should have expected 'ewrite' attribute """
        attribute_name = 'ewrite'
        func = getattr(reportbug_ui_urwid, attribute_name)
        expect_func = getattr(reportbug_ui_text, attribute_name)
        fail_msg = (
            "Module attribute %(attribute_name)r"
            " should be object %(expect_func)r"
            ) % vars()
        self.failUnlessIs(expect_func, func, msg=fail_msg)

class Test_spawn_editor(TestCase):
    """ Test cases for 'spawn_editor' """

    def test_is_expected_object(self):
        """ Module should have expected 'spawn_editor' attribute """
        attribute_name = 'spawn_editor'
        func = getattr(reportbug_ui_urwid, attribute_name)
        expect_func = getattr(reportbug_ui_text, attribute_name)
        fail_msg = (
            "Module attribute %(attribute_name)r"
            " should be object %(expect_func)r"
            ) % vars()
        self.failUnlessIs(expect_func, func, msg=fail_msg)