[MERGE] unclutter progress bars when using GPG

John Arbash Meinel john at arbash-meinel.com
Fri Aug 25 18:37:14 BST 2006


Aaron Bentley wrote:
> John Arbash Meinel wrote:
> 
>>> Well, you just use the same signing routine but make the 'gpg signing
>>> command' is different. We already have tests that do that. (though you
>>> have to get extra tricky, because you can't guarantee that standard
>>> commands exist on Windows)
> 
> How's this?
> 
> Aaron

+
+    def test_clears_progress(self):
+        content = "some content\nwith newlines\n"
+        old_clear_term = ui.ui_factory.clear_term
+        clear_term_called = [False]
+        def clear_term():
+            old_clear_term()
+            clear_term_called == [False]
+            clear_term_called[0] = True
+        ui.ui_factory.clear_term = clear_term
+        try:
+            self.assertProduces(content)
+        finally:
+            ui.ui_factory.clear_term = old_clear_term
+        self.assertEqual([True], clear_term_called)
+

I think the test is better done as:

clear_term_called = []

def clear_term():
	old_clear_term()
	clear_term_called.append(True)

And then you could either assert that there was 1 True, or the length
was > 1.
Also your line:
clear_term_called == [False]

Doesn't do anything.

So with the test cleaned up, +1 from me.

John
=:->

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060825/fc38eed7/attachment.pgp 


More information about the bazaar mailing list