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

Side by Side Diff: Lib/test/test_time.py

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 months ago
Left:
Right:
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 unified diff | Download patch
« no previous file with comments | « Lib/test/test_threading.py ('k') | Lib/test/test_tk.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 from test import support 1 from test import support
2 import time 2 import time
3 import unittest 3 import unittest
4 import locale 4 import locale
5 import sysconfig 5 import sysconfig
6 import sys 6 import sys
7 import warnings 7 import warnings
8 8
9 class TimeTestCase(unittest.TestCase): 9 class TimeTestCase(unittest.TestCase):
10 10
11 def setUp(self): 11 def setUp(self):
12 self.t = time.time() 12 self.t = time.time()
13 13
14 def test_data_attributes(self): 14 def test_data_attributes(self):
15 time.altzone 15 time.altzone
16 time.daylight 16 time.daylight
17 time.timezone 17 time.timezone
18 time.tzname 18 time.tzname
19 19
20 def test_clock(self): 20 def test_clock(self):
21 time.clock() 21 time.clock()
22 22
23 def test_conversions(self): 23 def test_conversions(self):
24 self.assertEqual(time.ctime(self.t), 24 self.assertEqual(time.ctime(self.t),
25 time.asctime(time.localtime(self.t))) 25 time.asctime(time.localtime(self.t)))
26 self.assertEqual(int(time.mktime(time.localtime(self.t))), 26 self.assertEqual(int(time.mktime(time.localtime(self.t))),
27 int(self.t)) 27 int(self.t))
28 28
29 def test_sleep(self): 29 def test_sleep(self):
30 self.assertRaises(ValueError, time.sleep, -2)
31 self.assertRaises(ValueError, time.sleep, -1)
32 time.sleep(1.2) 30 time.sleep(1.2)
33 31
34 def test_strftime(self): 32 def test_strftime(self):
35 tt = time.gmtime(self.t) 33 tt = time.gmtime(self.t)
36 for directive in ('a', 'A', 'b', 'B', 'c', 'd', 'H', 'I', 34 for directive in ('a', 'A', 'b', 'B', 'c', 'd', 'H', 'I',
37 'j', 'm', 'M', 'p', 'S', 35 'j', 'm', 'M', 'p', 'S',
38 'U', 'w', 'W', 'x', 'X', 'y', 'Y', 'Z', '%'): 36 'U', 'w', 'W', 'x', 'X', 'y', 'Y', 'Z', '%'):
39 format = ' %' + directive 37 format = ' %' + directive
40 try: 38 try:
41 time.strftime(format, tt) 39 time.strftime(format, tt)
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 346
349 def test_main(): 347 def test_main():
350 support.run_unittest( 348 support.run_unittest(
351 TimeTestCase, 349 TimeTestCase,
352 TestLocale, 350 TestLocale,
353 TestAsctime4dyear, 351 TestAsctime4dyear,
354 TestStrftime4dyear) 352 TestStrftime4dyear)
355 353
356 if __name__ == "__main__": 354 if __name__ == "__main__":
357 test_main() 355 test_main()
OLDNEW
« no previous file with comments | « Lib/test/test_threading.py ('k') | Lib/test/test_tk.py » ('j') | no next file with comments »

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