[MERGE] Add get_username() call to the UIFactory.

Jelmer Vernooij jelmer at samba.org
Wed Apr 1 00:55:31 BST 2009


Thanks again for the quick review; I've fixed the issues you raised,
but I'm not sure about the last one. 

On Tue, Mar 31, 2009 at 05:14:39PM +0200, Vincent Ladeuil wrote:
> >>>>> "Jelmer" == Jelmer Vernooij <jelmer at samba.org> writes:
>     Jelmer> +        """
>     Jelmer> +        prompt += ': '
>     Jelmer> +        prompt = (prompt % kwargs)
>     Jelmer> +        self.prompt(prompt)
>     Jelmer> +        return self.stdin.readline().rstrip("\n")

> get_non_echoed_password can raise NotATerminal and encode the
> prompt according to the terminal encoding, I think get_username
> should do the same, time to refactor...
I think that's because get_non_echoed_password() uses getpass.getpass().
NotATerminal's error message specifically mentions "password" and
get_boolean() works fine without it. Is there any reason why we should raise 
that exception even if it wouldn't cause issues?

TestUIFactory provides a custom implementation of
get_non_echoed_password(); making it provide a mock implementation
of get_username() that doesn't raise NotATerminal seems kind of pointless as 
we would only be testing the mock implementation, not the actual one.

> With the missing tests added, that's

> BB:tweak

Cheers,

Jelmer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 315 bytes
Desc: Digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20090401/286ced7e/attachment.pgp 


More information about the bazaar mailing list