{G_Tc @ s d d l Z d d l Z d d l m Z d d l Z d d l Z d Z d Z d e j f d YZ d e j f d YZ
d e j f d
YZ d e f d YZ d
e f d YZ
d e j f d YZ d e j f d YZ d Z e d k re n d S( iN( t test_supports"
2004
January February March
Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su
1 2 3 4 1 1 2 3 4 5 6 7
5 6 7 8 9 10 11 2 3 4 5 6 7 8 8 9 10 11 12 13 14
12 13 14 15 16 17 18 9 10 11 12 13 14 15 15 16 17 18 19 20 21
19 20 21 22 23 24 25 16 17 18 19 20 21 22 22 23 24 25 26 27 28
26 27 28 29 30 31 23 24 25 26 27 28 29 29 30 31
April May June
Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su
1 2 3 4 1 2 1 2 3 4 5 6
5 6 7 8 9 10 11 3 4 5 6 7 8 9 7 8 9 10 11 12 13
12 13 14 15 16 17 18 10 11 12 13 14 15 16 14 15 16 17 18 19 20
19 20 21 22 23 24 25 17 18 19 20 21 22 23 21 22 23 24 25 26 27
26 27 28 29 30 24 25 26 27 28 29 30 28 29 30
31
July August September
Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su
1 2 3 4 1 1 2 3 4 5
5 6 7 8 9 10 11 2 3 4 5 6 7 8 6 7 8 9 10 11 12
12 13 14 15 16 17 18 9 10 11 12 13 14 15 13 14 15 16 17 18 19
19 20 21 22 23 24 25 16 17 18 19 20 21 22 20 21 22 23 24 25 26
26 27 28 29 30 31 23 24 25 26 27 28 29 27 28 29 30
30 31
October November December
Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su
1 2 3 1 2 3 4 5 6 7 1 2 3 4 5
4 5 6 7 8 9 10 8 9 10 11 12 13 14 6 7 8 9 10 11 12
11 12 13 14 15 16 17 15 16 17 18 19 20 21 13 14 15 16 17 18 19
18 19 20 21 22 23 24 22 23 24 25 26 27 28 20 21 22 23 24 25 26
25 26 27 28 29 30 31 29 30 27 28 29 30 31
s;;
2004 |
---|
January |
Mon | Tue | Wed | Thu | Fri | Sat | Sun |
| | | 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 | |
|
February |
Mon | Tue | Wed | Thu | Fri | Sat | Sun |
| | | | | | 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
|
March |
Mon | Tue | Wed | Thu | Fri | Sat | Sun |
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 | | | | |
|
April |
Mon | Tue | Wed | Thu | Fri | Sat | Sun |
| | | 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | | |
|
May |
Mon | Tue | Wed | Thu | Fri | Sat | Sun |
| | | | | 1 | 2 |
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 | | | | | | |
|
June |
Mon | Tue | Wed | Thu | Fri | Sat | Sun |
| 1 | 2 | 3 | 4 | 5 | 6 |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 | | | | |
|
July |
Mon | Tue | Wed | Thu | Fri | Sat | Sun |
| | | 1 | 2 | 3 | 4 |
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 | |
|
August |
Mon | Tue | Wed | Thu | Fri | Sat | Sun |
| | | | | | 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 | | | | | |
|
September |
Mon | Tue | Wed | Thu | Fri | Sat | Sun |
| | 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | | | |
|
October |
Mon | Tue | Wed | Thu | Fri | Sat | Sun |
| | | | 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
|
November |
Mon | Tue | Wed | Thu | Fri | Sat | Sun |
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | | | | | |
|
December |
Mon | Tue | Wed | Thu | Fri | Sat | Sun |
| | 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 | | |
|
t OutputTestCasec B s, e Z d Z d Z d Z d Z RS( c C sS d } g } x= | j t D], } | r t | | r | j | q q W| S( Nc S s | j o | j S( N( t isspacet isdigit( t c( ( s. /usr/local/lib/python2.7/test/test_calendar.pyt neitherspacenordigit s ( t
splitlinest Falset filtert append( t selft sR t linest line( ( s. /usr/local/lib/python2.7/test/test_calendar.pyt normalize_calendar s c C s/ | j | j t j d | j t d S( Ni ( t assertEqualR t calendart result_2004_text( R
( ( s. /usr/local/lib/python2.7/test/test_calendar.pyt test_output s c C s/ | j t j j d j t j d S( Ni ( R R t TextCalendart
formatyeart stripR ( R
( ( s. /usr/local/lib/python2.7/test/test_calendar.pyt test_output_textcalendar s c C s/ | j t j j d j t j d S( Ni ( R R t HTMLCalendart formatyearpageR t result_2004_html( R
( ( s. /usr/local/lib/python2.7/test/test_calendar.pyt test_output_htmlcalendar s ( t __name__t
__module__R R R R ( ( ( s. /usr/local/lib/python2.7/test/test_calendar.pyR s t CalendarTestCasec B sG e Z d Z d Z d Z d Z d Z d Z d Z RS( c C sh | j t j d d | j t j d d | j t j d d | j t j d d d S( Ni i i i i i ( R R t isleap( R
( ( s. /usr/local/lib/python2.7/test/test_calendar.pyt test_isleap s c C s | j t t j d | j t t j d | j t t j d t j } t j t j | j t j t j t j t j | j t j t j t j | d S( Nt flabberii ( t assertRaisest
ValueErrorR t setfirstweekdayt firstweekdayt SUNDAYR t MONDAY( R
t orig( ( s. /usr/local/lib/python2.7/test/test_calendar.pyt test_setfirstweekday s c C sb | j t t j j d | j t t j j d | j t g t j D] } | ^ qE d d S( Nii
i ( R! t
IndexErrorR t day_abbrt __getitem__t day_nameR t len( R
t d( ( s. /usr/local/lib/python2.7/test/test_calendar.pyt test_enumerateweekdays s c C s x d D] } t t | } | j t | d | j t | d | j t t | d | j | d d d t t | q Wd S( NR, R* i i( s day_names day_abbr( t getattrR R R- t sett listt reversed( R
t attrt value( ( s. /usr/local/lib/python2.7/test/test_calendar.pyt test_days s
c C s x d D] } t t | } | j t | d | j t | d | j | d d | j t t | d | j | d d d t t | q Wd S( Nt
month_namet
month_abbri
i t i( R7 R8 ( R0 R R R- R1 R2 R3 ( R
R4 R5 ( ( s. /usr/local/lib/python2.7/test/test_calendar.pyt test_months s
c C s@ t j j d d d } y= t j d d } | j d d } | j d d d } Wn# t j k
r} t j d n X| j d | j d | j
t | d | j t | d t j
d d } | j d } | j d d } | j d | j d t j j d d d } | j
| | d S( Ni i
t localeR9 i s$ cannot set the system default locales utf-8( R R t formatmonthnamet LocaleTextCalendart
formatweekdayR; t Errort unittestt SkipTestt encodeR R- t assertGreaterEqualt LocaleHTMLCalendar( R
t old_octobert calt
local_weekdayt local_montht new_october( ( s. /usr/local/lib/python2.7/test/test_calendar.pyt test_localecalendars s$
c C s# t t j j t j d d S( Ni ( R2 R t Calendart itermonthdatest datetimet MAXYEAR( R
( ( s. /usr/local/lib/python2.7/test/test_calendar.pyt test_itermonthdates s ( R R R R( R/ R6 R: RJ RO ( ( ( s. /usr/local/lib/python2.7/test/test_calendar.pyR s
t MonthCalendarTestCasec B s# e Z d Z d Z d Z RS( c C s# t j | _ t j | j d S( N( R R$ t oldfirstweekdayR# ( R
( ( s. /usr/local/lib/python2.7/test/test_calendar.pyt setUp s c C s t j | j d S( N( R R# RQ ( R
( ( s. /usr/local/lib/python2.7/test/test_calendar.pyt tearDown! s c C sw t j | | } | j t | t | xB t t | D]. } | j | | t d | | D qA Wd S( Nc s s | ] } | d k Vq d S( i N( ( t .0t day( ( s. /usr/local/lib/python2.7/test/test_calendar.pys