572
572
def test_confirm_action(self):
573
573
"""You can write tests that demonstrate user confirmation.
575
Specifically, ScriptRunner does't care if the output line for the prompt
576
isn't terminated by a newline from the program; it's implicitly terminated
575
Specifically, ScriptRunner does't care if the output line for the
576
prompt isn't terminated by a newline from the program; it's implicitly
577
terminated by the input.
579
579
commands.builtin_command_registry.register(cmd_test_confirm)
580
580
self.addCleanup(commands.builtin_command_registry.remove, 'test-confirm')
581
581
self.run_script("""
582
582
$ bzr test-confirm
583
2>Really do it? [y/n]:
583
2>Really do it? ([y]es, [n]o): yes
586
586
$ bzr test-confirm
587
2>Really do it? [y/n]:
587
2>Really do it? ([y]es, [n]o): no
592
class TestShelve(script.TestCaseWithTransportAndScript):
595
super(TestShelve, self).setUp()
598
Created a standalone tree (format: 2a)
603
$ bzr commit -m 'file added'
604
2>Committing to:...test/
606
2>Committed revision 1.
610
def test_shelve(self):
612
$ bzr shelve -m 'shelve bar'
613
2>Shelve? ([y]es, [N]o, [f]inish, [q]uit): yes
617
2>Shelve 1 change(s)? ([y]es, [N]o, [f]inish, [q]uit): yes
619
2>Changes shelved with id "1".
621
null_output_matches_anything=True)
627
def test_dont_shelve(self):
628
# We intentionally provide no input here to test EOF
630
$ bzr shelve -m 'shelve bar'
631
2>Shelve? ([y]es, [N]o, [f]inish, [q]uit):
632
2>No changes to shelve.
634
null_output_matches_anything=True)