#!/www/python/bin/python
"""$URL: svn+ssh://svn/repos/trunk/dulcinea/lib/ui/test/utest_util.py $
$Id: utest_util.py 25075 2004-09-10 18:27:41Z dbinger $
"""
from quixote import enable_ptl
enable_ptl()
from sancho.utest import UTest
from dulcinea.ui.util import comma_format


class MiscTest (UTest):

    def check_comma (self):
        assert comma_format(0) == "0"
        assert comma_format(1) == "1"
        assert comma_format(15) == "15"
        assert comma_format(953) == "953"
        assert comma_format(1001) == "1,001"
        assert comma_format(10543) == "10,543"
        assert comma_format(1024*1024) == "1,048,576"
        assert comma_format(10L**21-1) == "999,999,999,999,999,999,999"

if __name__ == "__main__":
    MiscTest()
