[yum-commits] Branch 'yum-3_2_X' - output.py
James Antill
james at osuosl.org
Wed Jan 20 16:37:41 UTC 2010
output.py | 12 ++++++++++++
1 file changed, 12 insertions(+)
New commits:
commit 3e5cee8ba6d4ff0996cdcad66b4b2c5403376250
Author: James Antill <james at and.org>
Date: Mon Jan 18 12:14:04 2010 -0500
Add manual tests for format_number.
diff --git a/output.py b/output.py
index 15a34a5..456e1cf 100755
--- a/output.py
+++ b/output.py
@@ -1905,6 +1905,18 @@ def progressbar(current, total, name=None):
if __name__ == "__main__":
+ if len(sys.argv) > 1 and sys.argv[1] == "format_number":
+ print ""
+ print " Doing format_number tests, right column should align"
+ print ""
+
+ x = YumOutput()
+ for i in (0, 0.0, 0.1, 1, 1.0, 1.1, 10, 11, 11.1, 100, 111.1,
+ 1000, 1111, 1024 * 2, 10000, 11111, 99999, 999999,
+ 10**19, 10**20, 10**35):
+ out = x.format_number(i)
+ print "%36s <%s> %s <%5s>" % (i, out, ' ' * (14 - len(out)), out)
+
if len(sys.argv) > 1 and sys.argv[1] == "progress":
print ""
print " Doing progress, small name"
More information about the Yum-commits
mailing list