Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(33)

Unified Diff: Lib/test/test_email/test_utils.py

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Lib/test/test_email/test_email.py ('k') | Lib/test/test_exceptions.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/test/test_email/test_utils.py Tue Jul 26 09:37:46 2011 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-import datetime
-from email import utils
-import unittest
-
-class DateTimeTests(unittest.TestCase):
-
- datestring = 'Sun, 23 Sep 2001 20:10:55'
- dateargs = (2001, 9, 23, 20, 10, 55)
- offsetstring = ' -0700'
- utcoffset = datetime.timedelta(hours=-7)
- tz = datetime.timezone(utcoffset)
- naive_dt = datetime.datetime(*dateargs)
- aware_dt = datetime.datetime(*dateargs, tzinfo=tz)
-
- def test_naive_datetime(self):
- self.assertEqual(utils.format_datetime(self.naive_dt),
- self.datestring + ' -0000')
-
- def test_aware_datetime(self):
- self.assertEqual(utils.format_datetime(self.aware_dt),
- self.datestring + self.offsetstring)
-
- def test_usegmt(self):
- utc_dt = datetime.datetime(*self.dateargs,
- tzinfo=datetime.timezone.utc)
- self.assertEqual(utils.format_datetime(utc_dt, usegmt=True),
- self.datestring + ' GMT')
-
- def test_usegmt_with_naive_datetime_raises(self):
- with self.assertRaises(ValueError):
- utils.format_datetime(self.naive_dt, usegmt=True)
-
- def test_usegmt_with_non_utc_datetime_raises(self):
- with self.assertRaises(ValueError):
- utils.format_datetime(self.aware_dt, usegmt=True)
-
- def test_parsedate_to_datetime(self):
- self.assertEqual(
- utils.parsedate_to_datetime(self.datestring + self.offsetstring),
- self.aware_dt)
-
- def test_parsedate_to_datetime_naive(self):
- self.assertEqual(
- utils.parsedate_to_datetime(self.datestring + ' -0000'),
- self.naive_dt)
« no previous file with comments | « Lib/test/test_email/test_email.py ('k') | Lib/test/test_exceptions.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+