Back to index

python3.2  3.2.2
Public Member Functions
test.test_calendar.OutputTestCase Class Reference

List of all members.

Public Member Functions

def normalize_calendar
def test_output
def test_output_textcalendar
def test_output_htmlcalendar

Detailed Description

Definition at line 173 of file test_calendar.py.


Member Function Documentation

Definition at line 174 of file test_calendar.py.

00174 
00175     def normalize_calendar(self, s):
00176         # Filters out locale dependent strings
00177         def neitherspacenordigit(c):
00178             return not c.isspace() and not c.isdigit()
00179 
00180         lines = []
00181         for line in s.splitlines(False):
00182             # Drop texts, as they are locale dependent
00183             if line and not filter(neitherspacenordigit, line):
00184                 lines.append(line)
00185         return lines

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 186 of file test_calendar.py.

00186 
00187     def test_output(self):
00188         self.assertEqual(
00189             self.normalize_calendar(calendar.calendar(2004)),
00190             self.normalize_calendar(result_2004_text)
00191         )

Here is the call graph for this function:

Definition at line 198 of file test_calendar.py.

00198 
00199     def test_output_htmlcalendar(self):
00200         encoding = 'ascii'
00201         cal = calendar.HTMLCalendar()
00202         self.assertEqual(
00203             cal.formatyearpage(2004, encoding=encoding).strip(b' \t\n'),
00204             result_2004_html.strip(' \t\n').encode(encoding)
00205         )
00206 

Here is the call graph for this function:

Definition at line 192 of file test_calendar.py.

00192 
00193     def test_output_textcalendar(self):
00194         self.assertEqual(
00195             calendar.TextCalendar().formatyear(2004).strip(),
00196             result_2004_text.strip()
00197         )

Here is the call graph for this function:


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