~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to doc/developers/testing.txt

  • Committer: Martin Pool
  • Date: 2010-09-10 06:35:30 UTC
  • mto: This revision was merged to the branch mainline in revision 5426.
  • Revision ID: mbp@sourcefrog.net-20100910063530-ntk3qfbtke6zmafl
Add list of confirmation ids

Show diffs side-by-side

added added

removed removed

Lines of Context:
446
446
            contents of file
447
447
            ''')
448
448
 
449
 
You can also test commands that read user interaction::
450
 
 
451
 
    def test_confirm_action(self):
452
 
        """You can write tests that demonstrate user confirmation"""
453
 
        commands.builtin_command_registry.register(cmd_test_confirm)
454
 
        self.addCleanup(commands.builtin_command_registry.remove, 'test-confirm')
455
 
        self.run_script("""
456
 
            $ bzr test-confirm
457
 
            2>Really do it? [y/n]: 
458
 
            <yes
459
 
            yes
460
 
            """)
461
449
 
462
450
Import tariff tests
463
451
-------------------
711
699
        _test_needs_features = [features.apport]
712
700
 
713
701
 
714
 
Testing deprecated code
715
 
-----------------------
716
 
 
717
 
When code is deprecated, it is still supported for some length of time,
718
 
usually until the next major version. The ``applyDeprecated`` helper
719
 
wraps calls to deprecated code to verify that it is correctly issuing the
720
 
deprecation warning, and also prevents the warnings from being printed
721
 
during test runs.
722
 
 
723
 
Typically patches that apply the ``@deprecated_function`` decorator should
724
 
update the accompanying tests to use the ``applyDeprecated`` wrapper.
725
 
 
726
 
``applyDeprecated`` is defined in ``bzrlib.tests.TestCase``. See the API
727
 
docs for more details.
728
 
 
729
 
 
730
702
Testing exceptions and errors
731
703
-----------------------------
732
704