]> git.ipfire.org Git - thirdparty/babel.git/commitdiff
fix tests
authorAlex Morega <alex@grep.ro>
Sun, 7 Jul 2013 08:30:12 +0000 (10:30 +0200)
committerAlex Morega <alex@grep.ro>
Sun, 7 Jul 2013 08:30:31 +0000 (10:30 +0200)
babel/support.py
tests/messages/test_mofile.py

index 5c76cd68004b2a6f122d791b036e1b768aafa65e..50a8b8d4d4ed7cff6a23bf853b9c8b975ef6f937 100644 (file)
@@ -35,6 +35,8 @@ class Format(object):
     """Wrapper class providing the various date and number formatting functions
     bound to a specific locale and time-zone.
 
+    >>> from babel.util import UTC
+    >>> from datetime import date
     >>> fmt = Format('en_US', UTC)
     >>> fmt.date(date(2007, 4, 1))
     u'Apr 1, 2007'
@@ -54,6 +56,7 @@ class Format(object):
     def date(self, date=None, format='medium'):
         """Return a date formatted according to the given pattern.
 
+        >>> from datetime import date
         >>> fmt = Format('en_US')
         >>> fmt.date(date(2007, 4, 1))
         u'Apr 1, 2007'
@@ -65,6 +68,7 @@ class Format(object):
     def datetime(self, datetime=None, format='medium'):
         """Return a date and time formatted according to the given pattern.
 
+        >>> from datetime import datetime
         >>> from pytz import timezone
         >>> fmt = Format('en_US', tzinfo=timezone('US/Eastern'))
         >>> fmt.datetime(datetime(2007, 4, 1, 15, 30))
@@ -78,6 +82,7 @@ class Format(object):
     def time(self, time=None, format='medium'):
         """Return a time formatted according to the given pattern.
 
+        >>> from datetime import datetime
         >>> from pytz import timezone
         >>> fmt = Format('en_US', tzinfo=timezone('US/Eastern'))
         >>> fmt.time(datetime(2007, 4, 1, 15, 30))
@@ -91,6 +96,7 @@ class Format(object):
                   format='medium', add_direction=False):
         """Return a time delta according to the rules of the given locale.
 
+        >>> from datetime import timedelta
         >>> fmt = Format('en_US')
         >>> fmt.timedelta(timedelta(weeks=11))
         u'3 months'
index 200704eb69ed9f831e8f56c618fb2e3e592cbc99..14d00b75e9fb8759c3607f3487924979ab4ec22e 100644 (file)
@@ -16,7 +16,7 @@ import unittest
 
 from babel.messages import mofile, Catalog
 from babel._compat import BytesIO
-from babel.util import Translations
+from babel.support import Translations
 
 
 class ReadMoTestCase(unittest.TestCase):