~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-13 04:41:17 UTC
  • mfrom: (5417.1.2 scripts)
  • mto: This revision was merged to the branch mainline in revision 5426.
  • Revision ID: mbp@sourcefrog.net-20100913044117-2wmxp0ahf4ptz0uf
Merge ScriptRunner interaction support

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
            """)
449
461
 
450
462
Import tariff tests
451
463
-------------------