Back to index

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

List of all members.

Public Member Functions

def test_february
def test_april
def test_december
def setUp
def tearDown
def check_weeks

Public Attributes

 oldfirstweekday

Static Public Attributes

 firstweekday = calendar.SUNDAY

Detailed Description

Definition at line 342 of file test_calendar.py.


Member Function Documentation

def test.test_calendar.MonthCalendarTestCase.check_weeks (   self,
  year,
  month,
  weeks 
) [inherited]

Definition at line 277 of file test_calendar.py.

00277 
00278     def check_weeks(self, year, month, weeks):
00279         cal = calendar.monthcalendar(year, month)
00280         self.assertEqual(len(cal), len(weeks))
00281         for i in range(len(weeks)):
00282             self.assertEqual(weeks[i], sum(day != 0 for day in cal[i]))
00283 

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 270 of file test_calendar.py.

00270 
00271     def setUp(self):
00272         self.oldfirstweekday = calendar.firstweekday()
00273         calendar.setfirstweekday(self.firstweekday)

Here is the caller graph for this function:

Definition at line 274 of file test_calendar.py.

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 364 of file test_calendar.py.

00364 
00365     def test_april(self):
00366         # A 30-day april starting on sunday (7+7+7+7+2 days)
00367         self.check_weeks(1923, 4, (7, 7, 7, 7, 2))
00368 
00369         # A 30-day april starting on monday (6+7+7+7+3 days)
00370         self.check_weeks(1918, 4, (6, 7, 7, 7, 3))
00371 
00372         # A 30-day april starting on saturday (1+7+7+7+7+1 days)
00373         self.check_weeks(1950, 4, (1, 7, 7, 7, 7, 1))
00374 
00375         # A 30-day april starting on friday (2+7+7+7+7 days)
00376         self.check_weeks(1960, 4, (2, 7, 7, 7, 7))
00377 
00378         # A 30-day april starting on thursday (3+7+7+7+6 days)
00379         self.check_weeks(1909, 4, (3, 7, 7, 7, 6))

Here is the call graph for this function:

Definition at line 380 of file test_calendar.py.

00380 
00381     def test_december(self):
00382         # A 31-day december starting on sunday (7+7+7+7+3 days)
00383         self.check_weeks(2080, 12, (7, 7, 7, 7, 3))
00384 
00385         # A 31-day december starting on monday (6+7+7+7+4 days)
00386         self.check_weeks(1941, 12, (6, 7, 7, 7, 4))
00387 
00388         # A 31-day december starting on saturday (1+7+7+7+7+2 days)
00389         self.check_weeks(1923, 12, (1, 7, 7, 7, 7, 2))
00390 
00391         # A 31-day december starting on wednesday (4+7+7+7+6 days)
00392         self.check_weeks(1948, 12, (4, 7, 7, 7, 6))
00393 
00394         # A 31-day december starting on thursday (3+7+7+7+7 days)
00395         self.check_weeks(1927, 12, (3, 7, 7, 7, 7))
00396 
00397         # A 31-day december starting on friday (2+7+7+7+7+1 days)
00398         self.check_weeks(1995, 12, (2, 7, 7, 7, 7, 1))

Here is the call graph for this function:

Definition at line 345 of file test_calendar.py.

00345 
00346     def test_february(self):
00347         # A 28-day february starting on sunday (7+7+7+7 days)
00348         self.check_weeks(2009, 2, (7, 7, 7, 7))
00349 
00350         # A 28-day february starting on monday (6+7+7+7+1 days)
00351         self.check_weeks(1999, 2, (6, 7, 7, 7, 1))
00352 
00353         # A 28-day february starting on saturday (1+7+7+7+6 days)
00354         self.check_weeks(1997, 2, (1, 7, 7, 7, 6))
00355 
00356         # A 29-day february starting on sunday (7+7+7+7+1 days)
00357         self.check_weeks(2004, 2, (7, 7, 7, 7, 1))
00358 
00359         # A 29-day february starting on monday (6+7+7+7+2 days)
00360         self.check_weeks(1960, 2, (6, 7, 7, 7, 2))
00361 
00362         # A 29-day february starting on saturday (1+7+7+7+7 days)
00363         self.check_weeks(1964, 2, (1, 7, 7, 7, 7))

Here is the call graph for this function:


Member Data Documentation

Definition at line 343 of file test_calendar.py.

Definition at line 271 of file test_calendar.py.


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