[MERGE] Add a get_login method to UIFactory and test get_password
Martin Pool
mbp at sourcefrog.net
Wed Feb 21 03:10:13 GMT 2007
Robert Collins wrote:
> On Wed, 2007-02-21 at 12:15 +1100, Martin Pool wrote:
>> Creating a pseudotty might work but that is obviously not portable and
>> really seems like we're getting into testing getpass rather than our
>> own
>> code...
>
> Perhaps we should just stub out getpass for our tests, rather than
> mucking about with stdin etc?
>
> This would be a useful interface for GUI's as well it occurs to me,
> because they probably dont want the console getpass to be triggered...
That sounds ok to me. It would mean we don't test that our calls to
getpass have the effect we expect, but given that it's hard to test that
might be reasonable.
Also I did a search and see that we already have a couple of factories
for testing, so perhaps we can reuse them:
tests/blackbox/__init__.py|124| class TestUIFactory(ui.CLIUIFactory):
tests/workingtree_implementations/test_commit.py|32| class
CapturingUIFactory(ui.UIFactory):
--
Martin
More information about the bazaar
mailing list