Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Public Attributes
test.test_time.Test4dyearBool Class Reference
Inheritance diagram for test.test_time.Test4dyearBool:
Inheritance graph
[legend]
Collaboration diagram for test.test_time.Test4dyearBool:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def yearstr
def test_large_year
def test_year
def test_negative
def test_mktime
def setUp
def tearDown
def yearstr

Public Attributes

 saved_accept2dyear

Static Public Attributes

 accept2dyear = False

Detailed Description

Definition at line 379 of file test_time.py.


Member Function Documentation

def test.test_time._BaseYearTest.setUp (   self) [inherited]

Definition at line 276 of file test_time.py.

00276 
00277     def setUp(self):
00278         self.saved_accept2dyear = time.accept2dyear
00279         time.accept2dyear = self.accept2dyear

Here is the caller graph for this function:

def test.test_time._BaseYearTest.tearDown (   self) [inherited]

Definition at line 280 of file test_time.py.

00280 
00281     def tearDown(self):
00282         time.accept2dyear = self.saved_accept2dyear

Here is the caller graph for this function:

Definition at line 290 of file test_time.py.

00290 
00291     def test_large_year(self):
00292         # Check that it doesn't crash for year > 9999
00293         self.assertEqual(self.yearstr(12345), '12345')
00294         self.assertEqual(self.yearstr(123456789), '123456789')

Here is the call graph for this function:

def test.test_time._Test4dYear.test_mktime (   self) [inherited]

Definition at line 347 of file test_time.py.

00347 
00348     def test_mktime(self):
00349         # Issue #1726687
00350         for t in (-2, -1, 0, 1):
00351             try:
00352                 tt = time.localtime(t)
00353             except (OverflowError, ValueError):
00354                 pass
00355             else:
00356                 self.assertEqual(time.mktime(tt), t)
00357         # It may not be possible to reliably make mktime return error
00358         # on all platfom.  This will make sure that no other exception
00359         # than OverflowError is raised for an extreme value.
00360         try:
00361             time.mktime((-1, 1, 1, 0, 0, 0, -1, -1, -1))
00362         except OverflowError:
00363             pass

Here is the call graph for this function:

def test.test_time._Test4dYear.test_negative (   self) [inherited]

Definition at line 335 of file test_time.py.

00335 
00336     def test_negative(self):
00337         try:
00338             text = self.yearstr(-1)
00339         except ValueError:
00340             # strftime() is limited to [1; 9999] with Visual Studio
00341             return
00342         self.assertIn(text, ('-1', '-001'))
00343 
00344         self.assertEqual(self.yearstr(-1234), '-1234')
00345         self.assertEqual(self.yearstr(-123456), '-123456')
00346 

Here is the call graph for this function:

def test.test_time._Test4dYear.test_year (   self) [inherited]

Definition at line 327 of file test_time.py.

00327 
00328     def test_year(self):
00329         self.assertIn(self.yearstr(1),     ('1', '0001'))
00330         self.assertIn(self.yearstr(68),   ('68', '0068'))
00331         self.assertIn(self.yearstr(69),   ('69', '0069'))
00332         self.assertIn(self.yearstr(99),   ('99', '0099'))
00333         self.assertIn(self.yearstr(999), ('999', '0999'))
00334         self.assertEqual(self.yearstr(9999), '9999')

Here is the call graph for this function:

def test.test_time._BaseYearTest.yearstr (   self,
  y 
) [inherited]

Definition at line 283 of file test_time.py.

00283 
00284     def yearstr(self, y):
00285         raise NotImplementedError()

Here is the caller graph for this function:

def test.test_time._TestAsctimeYear.yearstr (   self,
  y 
) [inherited]

Definition at line 287 of file test_time.py.

00287 
00288     def yearstr(self, y):
00289         return time.asctime((y,) + (0,) * 8).split()[-1]

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Reimplemented from test.test_time._Test4dYear.

Definition at line 380 of file test_time.py.

Definition at line 277 of file test_time.py.


The documentation for this class was generated from the following file: