/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to tests/test_commit.py

  • Committer: Vincent Ladeuil
  • Date: 2008-09-29 16:10:51 UTC
  • Revision ID: v.ladeuil+lp@free.fr-20080929161051-pn1akd7ja5eiviwk
Fix gtk dialogs popping up and asking for input during selftest.

* tests/test_commit.py:
(TestCommitDialog_Commit._set_question_yes,
TestCommitDialog_Commit._set_question_no): Accept keyword
arguments (but ignore them).
(TestCommitDialog_Commit.test_commit_empty_message): Rename the
test to avoid confusion with test_commit_no_messages.

* commit.py:
(CommitDialog.__init__): Restore the ability to override the
dialog used for automated tests.
(CommitDialog._do_commit, CommitDialog._do_commit,
CommitDialog._do_commit): Use the dialog class defined at
construction time.

Show diffs side-by-side

added added

removed removed

Lines of Context:
651
651
    def _set_question_yes(self, dlg):
652
652
        """Set the dialog to answer YES to any questions."""
653
653
        self.questions = []
654
 
        def _question_yes(*args):
 
654
        def _question_yes(*args, **kwargs):
655
655
            self.questions.append(args)
656
656
            self.questions.append('YES')
657
657
            return gtk.RESPONSE_YES
660
660
    def _set_question_no(self, dlg):
661
661
        """Set the dialog to answer NO to any questions."""
662
662
        self.questions = []
663
 
        def _question_no(*args):
 
663
        def _question_no(*args, **kwargs):
664
664
            self.questions.append(args)
665
665
            self.questions.append('NO')
666
666
            return gtk.RESPONSE_NO
708
708
        self.assertEqual(last_rev, dlg.committed_revision_id)
709
709
        self.assertEqual(last_rev, tree.branch.last_revision())
710
710
 
711
 
    def test_commit_no_message(self):
 
711
    def test_commit_empty_message(self):
712
712
        tree = self.make_branch_and_tree('tree')
713
713
        self.build_tree(['tree/a', 'tree/b'])
714
714
        tree.add(['a'], ['a-id'])