a ze @sBddlZddlZddlmZddlmZmZddlZddlZddl Z ddl Z ddl Z dZ dZ dZdZedd d d Zd Zgd gdgdgdgdggdgdgdgdgdggdgdgdgdgdgggd gdgdgdgdggdgdgdgd gd!gd"ggd#gd$gd%gd&gd'gggd gdgdgdgdggdgdgdgdgdgd(ggd)gd*gd+gd,gd-gggd.gd/gd0gd1gd2ggdgdgdgdgd3ggd)gd*gd+gd,gd4gggZgd5gd6gd7ggd8gd9gd:ggd;gd<gd=ggd>gd?gd@ggZGdAdBdBejZGdCdDdDejZGdEdFdFejZGdGdHdHeZGdIdJdJeZGdKdLdLejZGdMdNdNejZGdOdPdPejZdQdRZGdSdTdTejZGdUdVdVejZ GdWdXdXejZ!e"dYkr>e#dS)ZN)support)assert_python_okassert_python_failurez February 0 Mo Tu We Th Fr Sa Su 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 a 0 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 1 2 3 4 5 6 1 2 3 4 5 3 4 5 6 7 8 9 7 8 9 10 11 12 13 6 7 8 9 10 11 12 10 11 12 13 14 15 16 14 15 16 17 18 19 20 13 14 15 16 17 18 19 17 18 19 20 21 22 23 21 22 23 24 25 26 27 20 21 22 23 24 25 26 24 25 26 27 28 29 30 28 29 27 28 29 30 31 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 1 2 3 4 5 6 7 1 2 3 4 3 4 5 6 7 8 9 8 9 10 11 12 13 14 5 6 7 8 9 10 11 10 11 12 13 14 15 16 15 16 17 18 19 20 21 12 13 14 15 16 17 18 17 18 19 20 21 22 23 22 23 24 25 26 27 28 19 20 21 22 23 24 25 24 25 26 27 28 29 30 29 30 31 26 27 28 29 30 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 1 2 3 4 5 6 1 2 3 3 4 5 6 7 8 9 7 8 9 10 11 12 13 4 5 6 7 8 9 10 10 11 12 13 14 15 16 14 15 16 17 18 19 20 11 12 13 14 15 16 17 17 18 19 20 21 22 23 21 22 23 24 25 26 27 18 19 20 21 22 23 24 24 25 26 27 28 29 30 28 29 30 31 25 26 27 28 29 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 1 2 3 4 5 1 2 3 2 3 4 5 6 7 8 6 7 8 9 10 11 12 4 5 6 7 8 9 10 9 10 11 12 13 14 15 13 14 15 16 17 18 19 11 12 13 14 15 16 17 16 17 18 19 20 21 22 20 21 22 23 24 25 26 18 19 20 21 22 23 24 23 24 25 26 27 28 29 27 28 29 30 25 26 27 28 29 30 31 30 31 z January 2004 Mo Tu We Th Fr Sa Su 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 a! 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 yearmonthascii)rrencodingax; Calendar for 2004
2004
January
MonTueWedThuFriSatSun
   1234
567891011
12131415161718
19202122232425
262728293031 
February
MonTueWedThuFriSatSun
      1
2345678
9101112131415
16171819202122
23242526272829
March
MonTueWedThuFriSatSun
1234567
891011121314
15161718192021
22232425262728
293031    
April
MonTueWedThuFriSatSun
   1234
567891011
12131415161718
19202122232425
2627282930  
May
MonTueWedThuFriSatSun
     12
3456789
10111213141516
17181920212223
24252627282930
31      
June
MonTueWedThuFriSatSun
 123456
78910111213
14151617181920
21222324252627
282930    
July
MonTueWedThuFriSatSun
   1234
567891011
12131415161718
19202122232425
262728293031 
August
MonTueWedThuFriSatSun
      1
2345678
9101112131415
16171819202122
23242526272829
3031     
September
MonTueWedThuFriSatSun
  12345
6789101112
13141516171819
20212223242526
27282930   
October
MonTueWedThuFriSatSun
    123
45678910
11121314151617
18192021222324
25262728293031
November
MonTueWedThuFriSatSun
1234567
891011121314
15161718192021
22232425262728
2930     
December
MonTueWedThuFriSatSun
  12345
6789101112
13141516171819
20212223242526
2728293031  
)rrr) ) ))r)rrrrrrr )r r r r rrr)rrrrrrr)rrrrrrr)rr r!r"r#r$r%)r r r r r rr)rrrrrrr)rrrrrrr)rrr r!r"r#r$)r%r&r'rrrr)r"r#r$r%r&rr)rrrrrr r )r r r rrrr)rrrrrrr)rrrrrrr)r r!r"r#r$r%r&)r'rrrrrr)rr r r r r r)rrrrrrr)rrrrrrr)rrrr r!r"r#)r$r%r&rrrr)r&r'rrrrr)rrr r r r r )rrrrrrr)rrrrrrr)rrrrr r!r")r#r$r%r&rrr)rrrrr r r )r r rrrrr)rrrrrrr)rrrrrrr )r!r"r#r$r%r&r')r%r&rrrrr)r#r$r%r&r'rr)z>12/29/03 12/30/03 12/31/03 01/01/04 01/02/04 01/03/04 01/04/04z>01/05/04 01/06/04 01/07/04 01/08/04 01/09/04 01/10/04 01/11/04z>01/12/04 01/13/04 01/14/04 01/15/04 01/16/04 01/17/04 01/18/04z>01/19/04 01/20/04 01/21/04 01/22/04 01/23/04 01/24/04 01/25/04>01/26/04 01/27/04 01/28/04 01/29/04 01/30/04 01/31/04 02/01/04)r(z>02/02/04 02/03/04 02/04/04 02/05/04 02/06/04 02/07/04 02/08/04z>02/09/04 02/10/04 02/11/04 02/12/04 02/13/04 02/14/04 02/15/04z>02/16/04 02/17/04 02/18/04 02/19/04 02/20/04 02/21/04 02/22/04z>02/23/04 02/24/04 02/25/04 02/26/04 02/27/04 02/28/04 02/29/04)z>03/01/04 03/02/04 03/03/04 03/04/04 03/05/04 03/06/04 03/07/04z>03/08/04 03/09/04 03/10/04 03/11/04 03/12/04 03/13/04 03/14/04z>03/15/04 03/16/04 03/17/04 03/18/04 03/19/04 03/20/04 03/21/04z>03/22/04 03/23/04 03/24/04 03/25/04 03/26/04 03/27/04 03/28/04>03/29/04 03/30/04 03/31/04 04/01/04 04/02/04 04/03/04 04/04/04)r)z>04/05/04 04/06/04 04/07/04 04/08/04 04/09/04 04/10/04 04/11/04z>04/12/04 04/13/04 04/14/04 04/15/04 04/16/04 04/17/04 04/18/04z>04/19/04 04/20/04 04/21/04 04/22/04 04/23/04 04/24/04 04/25/04>04/26/04 04/27/04 04/28/04 04/29/04 04/30/04 05/01/04 05/02/04)r*z>05/03/04 05/04/04 05/05/04 05/06/04 05/07/04 05/08/04 05/09/04z>05/10/04 05/11/04 05/12/04 05/13/04 05/14/04 05/15/04 05/16/04z>05/17/04 05/18/04 05/19/04 05/20/04 05/21/04 05/22/04 05/23/04z>05/24/04 05/25/04 05/26/04 05/27/04 05/28/04 05/29/04 05/30/04>05/31/04 06/01/04 06/02/04 06/03/04 06/04/04 06/05/04 06/06/04)r+z>06/07/04 06/08/04 06/09/04 06/10/04 06/11/04 06/12/04 06/13/04z>06/14/04 06/15/04 06/16/04 06/17/04 06/18/04 06/19/04 06/20/04z>06/21/04 06/22/04 06/23/04 06/24/04 06/25/04 06/26/04 06/27/04>06/28/04 06/29/04 06/30/04 07/01/04 07/02/04 07/03/04 07/04/04)r,z>07/05/04 07/06/04 07/07/04 07/08/04 07/09/04 07/10/04 07/11/04z>07/12/04 07/13/04 07/14/04 07/15/04 07/16/04 07/17/04 07/18/04z>07/19/04 07/20/04 07/21/04 07/22/04 07/23/04 07/24/04 07/25/04>07/26/04 07/27/04 07/28/04 07/29/04 07/30/04 07/31/04 08/01/04)r-z>08/02/04 08/03/04 08/04/04 08/05/04 08/06/04 08/07/04 08/08/04z>08/09/04 08/10/04 08/11/04 08/12/04 08/13/04 08/14/04 08/15/04z>08/16/04 08/17/04 08/18/04 08/19/04 08/20/04 08/21/04 08/22/04z>08/23/04 08/24/04 08/25/04 08/26/04 08/27/04 08/28/04 08/29/04>08/30/04 08/31/04 09/01/04 09/02/04 09/03/04 09/04/04 09/05/04)r.z>09/06/04 09/07/04 09/08/04 09/09/04 09/10/04 09/11/04 09/12/04z>09/13/04 09/14/04 09/15/04 09/16/04 09/17/04 09/18/04 09/19/04z>09/20/04 09/21/04 09/22/04 09/23/04 09/24/04 09/25/04 09/26/04>09/27/04 09/28/04 09/29/04 09/30/04 10/01/04 10/02/04 10/03/04)r/z>10/04/04 10/05/04 10/06/04 10/07/04 10/08/04 10/09/04 10/10/04z>10/11/04 10/12/04 10/13/04 10/14/04 10/15/04 10/16/04 10/17/04z>10/18/04 10/19/04 10/20/04 10/21/04 10/22/04 10/23/04 10/24/04z>10/25/04 10/26/04 10/27/04 10/28/04 10/29/04 10/30/04 10/31/04)z>11/01/04 11/02/04 11/03/04 11/04/04 11/05/04 11/06/04 11/07/04z>11/08/04 11/09/04 11/10/04 11/11/04 11/12/04 11/13/04 11/14/04z>11/15/04 11/16/04 11/17/04 11/18/04 11/19/04 11/20/04 11/21/04z>11/22/04 11/23/04 11/24/04 11/25/04 11/26/04 11/27/04 11/28/04>11/29/04 11/30/04 12/01/04 12/02/04 12/03/04 12/04/04 12/05/04)r0z>12/06/04 12/07/04 12/08/04 12/09/04 12/10/04 12/11/04 12/12/04z>12/13/04 12/14/04 12/15/04 12/16/04 12/17/04 12/18/04 12/19/04z>12/20/04 12/21/04 12/22/04 12/23/04 12/24/04 12/25/04 12/26/04z>12/27/04 12/28/04 12/29/04 12/30/04 12/31/04 01/01/05 01/02/05c@seZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZddZddZdd Zd!d"Zd#d$Zd%S)&OutputTestCasecCs:dd}g}|jddD]}|rt||s||q|S)NcSs| o| SN)isspaceisdigit)cr6F/opt/bitninja-python-dojo/embedded/lib/python3.9/test/test_calendar.pyneitherspacenordigitssz?OutputTestCase.normalize_calendar..neitherspacenordigitF)keepends) splitlinesfilterappend)selfsr8linesliner6r6r7normalize_calendarqs  z!OutputTestCase.normalize_calendarcCsLt}t}|pd|d<|jd|d}||tjfi||dS)Nutf-8r)r) calendar HTMLCalendardefault_formatcopyZformatyearpage assertEqualresult_2004_htmlformatencode)r=ZreqrescalZformat_outputr6r6r7check_htmlcalendar_encoding}s z*OutputTestCase.check_htmlcalendar_encodingcCs@||td|t||td|tdSNrCr)rHrArDresult_2004_text result_0_textr=r6r6r7 test_outputszOutputTestCase.test_outputcCs0|tdt|tdtdSrP)rHrD TextCalendar formatyearrQrRrSr6r6r7test_output_textcalendars  z'OutputTestCase.test_output_textcalendarcCs|dddS)NrrOrSr6r6r7'test_output_htmlcalendar_encoding_asciisz6OutputTestCase.test_output_htmlcalendar_encoding_asciicCs|dddS)NrBrXrSr6r6r7&test_output_htmlcalendar_encoding_utf8sz5OutputTestCase.test_output_htmlcalendar_encoding_utf8cCs|dtdSr2)rOsysgetdefaultencodingrSr6r6r7)test_output_htmlcalendar_encoding_defaultsz8OutputTestCase.test_output_htmlcalendar_encoding_defaultcCs&dd}||tdtdS)NcSsdd|DS)NcSsg|]}dd|DqS)cSsg|]}dd|DqS)cSs g|]}ddd|DqS) css.|]&}d|j|jt|jddVqdS)z{:02d}/{:02d}/{}N)rJrdaystrr.0dr6r6r7 sziOutputTestCase.test_yeardatescalendar..shrink.....)join)rczr6r6r7 s z_OutputTestCase.test_yeardatescalendar..shrink....r6)rcyr6r6r7rhszTOutputTestCase.test_yeardatescalendar..shrink...r6)rcxr6r6r7rhszIOutputTestCase.test_yeardatescalendar..shrink..r6)rMr6r6r7shrinksz5OutputTestCase.test_yeardatescalendar..shrinkrC)rHrDCalendarZyeardatescalendarresult_2004_dates)r=rkr6r6r7test_yeardatescalendars z%OutputTestCase.test_yeardatescalendarcCs|tdtdSNrC)rHrDrlZyeardayscalendarresult_2004_daysrSr6r6r7test_yeardayscalendars z$OutputTestCase.test_yeardayscalendarcCs|tdddS)Nr zMo Tu We Th Fr Sa SurHrDrUformatweekheaderrSr6r6r7test_formatweekheader_shorts z*OutputTestCase.test_formatweekheader_shortcCs|tdddS)NrzE Monday Tuesday Wednesday Thursday Friday Saturday Sunday rrrSr6r6r7test_formatweekheader_longs z)OutputTestCase.test_formatweekheader_longcCs4|tddt|tddtdS)NrCr rr )rHrDrU formatmonthresult_2004_01_textresult_0_02_textrSr6r6r7test_formatmonthszOutputTestCase.test_formatmonthcCs |tjddddddS)NrCr TZwithyearz8January 2004rHrDrEformatmonthnamerSr6r6r7test_formatmonthname_with_yearsz-OutputTestCase.test_formatmonthname_with_yearcCs |tjddddddS)NrCr Frzz3Januaryr{rSr6r6r7!test_formatmonthname_without_yearsz0OutputTestCase.test_formatmonthname_without_yearcCsTt8}gd}t|d||dWdn1sF0YdS)N))r r)r r )r r )r r )r r )rr )rrr z 1 2 3 4 5 6 7)rcaptured_stdoutrDrUprweekrHgetvalue)r=outweekr6r6r7 test_prweeks zOutputTestCase.test_prweekcCsLt0}tdd||tWdn1s>0YdS)NrCr )rrrDrUZprmonthrHrrwr=rr6r6r7 test_prmonths zOutputTestCase.test_prmonthcCsJt.}td||tWdn1s<0YdSro)rrrDrUZpryearrHrrQrr6r6r7 test_pryears zOutputTestCase.test_pryearcCsTt8}tjgdddd||dWdn1sF0YdS)N)123r r )ZcolwidthZspacingz 1 2 3)rrrDrJrHrstriprr6r6r7 test_formats zOutputTestCase.test_formatN)__name__ __module__ __qualname__rArOrTrWrYrZr]rnrqrtruryr}r~rrrrr6r6r6r7r1ps$      r1c@sdeZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ dS)CalendarTestCasecCsL|tdd|tdd|tdd|tdddS)Nir rii)rHrDZisleaprSr6r6r7 test_isleapszCalendarTestCase.test_isleapcCs|ttjd|ttjd|ttjdt}ttj|ttjttj|ttjt|dS)NZflabber) assertRaises TypeErrorrDsetfirstweekday ValueError firstweekdaySUNDAYrHMONDAY)r=Zorigr6r6r7test_setfirstweekdays  z%CalendarTestCase.test_setfirstweekdaycCs<|tjdtdWdn1s.0YdS)NZ123{)assertRaisesRegexrDZIllegalWeekdayErrorrrSr6r6r7test_illegal_weekday_reportedsz.CalendarTestCase.test_illegal_weekday_reportedcCsD|ttjjd|ttjjd|tddtjDddS)NircSsg|]}|qSr6r6rbr6r6r7rh z.r)r IndexErrorrDday_abbr __getitem__day_namerHlenrSr6r6r7test_enumerate_weekdayssz(CalendarTestCase.test_enumerate_weekdayscCsrdD]h}tt|}|t|d|t|ddd|tt|d||dddtt|qdS)N)rrrrgetattrrDrHrsetlistreversedr=attrvaluer6r6r7 test_days s  zCalendarTestCase.test_dayscCsdD]x}tt|}|t|d|t|ddd||dd|tt|d||dddtt|qdS)N)Z month_nameZ month_abbrrrrrrr6r6r7 test_monthss zCalendarTestCase.test_monthscCstddd}z*tjdd}|dd}|ddd}WntjyZtdYn0| |t | |t | t |d| t |dtjdd}|d}|dd}| |t | |t tddd}| ||dS)Nrr)localer $cannot set the system default locale)rDrUr|ZLocaleTextCalendarZ formatweekdayrErrorunittestZSkipTestZassertIsInstancerarHrZassertGreaterEqualZLocaleHTMLCalendar)r=Z old_octoberrMZ local_weekdayZ local_monthZ new_octoberr6r6r7test_locale_calendars s$         z&CalendarTestCase.test_locale_calendarscCstttjddS)Nr)rrDrlZitermonthdays3datetimeZMAXYEARrSr6r6r7test_itermonthdays37sz$CalendarTestCase.test_itermonthdays3cCs@tjdd}t|dd}||dd||dddS) Nr rrr r)rr r r r)rr r$r )rDrlrZitermonthdays4rH)r=rMdaysr6r6r7test_itermonthdays4;s z$CalendarTestCase.test_itermonthdays4cCs|tdD]<}t|}dD](\}}t|||}|t|dqqtjdd}t|dd}||ttdd dS) Nr)r r )i'r)#*r rrr r r%)rangerDrlrZ itermonthdaysassertInrrHr=rrMrimrr6r6r7test_itermonthdaysAs    z#CalendarTestCase.test_itermonthdayscCsjtdD]\}t|}dD]H\}}t|||}||dd|||dd|ddqqdS)Nrrrr r)rrDrlrZitermonthdays2rHrr6r6r7test_itermonthdays2Ms    z$CalendarTestCase.test_itermonthdays2N)rrrrrrrrrrrrrrr6r6r6r7rs     rc@s$eZdZddZddZddZdS)MonthCalendarTestCasecCst|_t|jdSr2)rDroldfirstweekdayrrSr6r6r7setUpXs zMonthCalendarTestCase.setUpcCst|jdSr2)rDrrrSr6r6r7tearDown\szMonthCalendarTestCase.tearDowncCsXt||}|t|t|tt|D]&}|||tdd||Dq,dS)Ncss|]}|dkVqdS)rNr6)rcr`r6r6r7recrz4MonthCalendarTestCase.check_weeks..)rDZ monthcalendarrHrrsum)r=rrweeksrMir6r6r7 check_weeks_s z!MonthCalendarTestCase.check_weeksN)rrrrrrr6r6r6r7rWsrc@s*eZdZejZddZddZddZdS)MondayTestCasecCsX|ddd|ddd|ddd|ddd |d dd |d dd dS)Nr rrrrirrrrr r rrrrrrrrr irrrrr rCr rrrrrrSr6r6r7 test_februaryis zMondayTestCase.test_februarycCsJ|ddd|ddd|ddd|ddd |d dd dS) Nir rrrrr irrrrr ir rrrrr r rrrrir rrrrrrSr6r6r7 test_april|s zMondayTestCase.test_aprilcCsX|ddd|ddd|ddd|ddd |d dd |d dd dS)Nirrrrrr rrrrrr ir rrrrr rr rrrrr rrrrir rrrrr rrSr6r6r7 test_decembers zMondayTestCase.test_decemberN) rrrrDrrrrrr6r6r6r7rfsrc@s*eZdZejZddZddZddZdS)SundayTestCasecCsX|ddd|ddd|ddd|ddd |d dd |d dd dS)Nir rrrrrCrrirrrSr6r6r7rs zSundayTestCase.test_februarycCsJ|ddd|ddd|ddd|ddd |d dd dS) Nr ri~rirrriurrrSr6r6r7rs zSundayTestCase.test_aprilcCsX|ddd|ddd|ddd|ddd |d dd |d dd dS)Ni rrirrririrrrrrSr6r6r7rs zSundayTestCase.test_decemberN) rrrrDrrrrrr6r6r6r7rsrc@seZdZgdZddZdS)TimegmTestCase) rrdii'ii@BiIi;=Ki LcCs,|jD] }t|}||t|qdSr2) TIMESTAMPStimegmtimerHrDZtimegm)r=Zsecstupler6r6r7 test_timegms  zTimegmTestCase.test_timegmN)rrrrrr6r6r6r7rsrc@sDeZdZddZddZddZddZd d Zd d Zd dZ dS)MonthRangeTestCasecCs|tddddS)NrCr )r r'rHrD monthrangerSr6r6r7 test_januaryszMonthRangeTestCase.test_januarycCs|tddddS)NrCr )rr%rrSr6r6r7test_february_leapsz%MonthRangeTestCase.test_february_leapcCs|tddddS)Nrr )rr$rrSr6r6r7test_february_nonleapsz(MonthRangeTestCase.test_february_nonleapcCs|tddddS)NrCr)r r'rrSr6r6r7rsz MonthRangeTestCase.test_decembercCs<|tjtddWdn1s.0YdSrPrrDIllegalMonthErrorrrSr6r6r7test_zeroth_monthsz$MonthRangeTestCase.test_zeroth_monthcCs<|tjtddWdn1s.0YdS)NrCrrrSr6r6r7test_thirteenth_monthsz(MonthRangeTestCase.test_thirteenth_monthcCs>|tjdtddWdn1s00YdS)NZ65rCA)rrDrrrSr6r6r7test_illegal_month_reportedsz.MonthRangeTestCase.test_illegal_month_reportedN) rrrrrrrrrrr6r6r6r7rsrc@s4eZdZddZddZddZddZd d Zd S) LeapdaysTestCasecCs|tddddS)NrrrHrDZleapdaysrSr6r6r7 test_no_rangeszLeapdaysTestCase.test_no_rangecCs|tddddS)NrirrrSr6r6r7test_no_leapdayssz!LeapdaysTestCase.test_no_leapdayscCs|tddddS)NrrrrSr6r6r7test_no_leapdays_upper_boundary sz0LeapdaysTestCase.test_no_leapdays_upper_boundarycCs|tddddS)Nrir rrSr6r6r7test_one_leapday_lower_boundary sz0LeapdaysTestCase.test_one_leapday_lower_boundarycCs|tddddS)Nrir rrSr6r6r7test_several_leapyears_in_rangesz0LeapdaysTestCase.test_several_leapyears_in_rangeN)rrrrrrrrr6r6r6r7rs rcCs|dtjS)N )replaceoslineseprK)r>r6r6r7convsr c@seZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZddZddZddZdd Zd!d"Zd#S)$CommandLineTestCasecGstddg|RdS)N-mrDr )r)r=argsr6r6r7run_okszCommandLineTestCase.run_okcGs4tddg|R\}}}|d|||ddS)NrrDusage:r )rrrH)r=rrcstdoutstderrr6r6r7 assertFailures z!CommandLineTestCase.assertFailurecCs2|d}|d||d||d|dS)Nz-hrs calendar.pys--help)rrr=rr6r6r7 test_help!s   zCommandLineTestCase.test_helpcCs4|d|d|dd|dddddS)Nz-zspam2004-thtmlr)rrSr6r6r7test_illegal_arguments's   z*CommandLineTestCase.test_illegal_argumentscCsD|}tjj}|d|||d||d|dS)Nz %ssJanuarysMo Tu We Th Fr Sa SurrZnowrrrKr=rrr6r6r7test_output_current_year-s   z,CommandLineTestCase.test_output_current_yearcCs|d}||ttdS)Nr)rrHr rQrr6r6r7test_output_year4s z$CommandLineTestCase.test_output_yearcCs |dd}||ttdS)Nrr)rrHr rwrr6r6r7test_output_month8s z%CommandLineTestCase.test_output_monthcCs8|d|d|ddd}||tddS)Nz-e --encodingz utf-16-ler)rrrHrQrKrr6r6r7test_option_encoding<s  z(CommandLineTestCase.test_option_encodingc Cs|d|d|ddt\}}|p2d}|p:d}zFttj}z$ttj||fWttj|nttj|0Wn"tjtfy|dYn0| d|d|d}| d ||dS) Nz-Lz--localeenCzUTF-8rr"r) rrgetdefaultlocale getlocaleLC_TIME setlocalerrZskipTestrrrK)r=langencZ oldlocalerr6r6r7test_option_localeBs     $z&CommandLineTestCase.test_option_localecCs>|d|d|dd|ddd}|d|dS)Nz-wz--widthrrrsMon Tue Wed Thu Fri Sat Sunrrrrr6r6r7test_option_widthTs    z%CommandLineTestCase.test_option_widthcCsB|d|d|dd|ddd}|td|dS)Nz-lz--linesrrrzDecember Mo Tu Werrrr rr6r6r7test_option_lines[s    z%CommandLineTestCase.test_option_linescCs>|d|d|dd|ddd}|d|dS)Nz-sz --spacingr8rs Su Mor-rr6r6r7test_option_spacingbs    z'CommandLineTestCase.test_option_spacingcCsB|d|d|dd|ddd}|td|dS)Nrz--monthrz--monthsrrz Mo Tu We Th Fr Sa Su r/rr6r6r7test_option_monthsis    z&CommandLineTestCase.test_option_monthscCsp|d|d|dd|ddd}||tt|ddd}||ddd|d |dS) Nr--typertextrrrsCalendar for 2004)rrrHr rQrrr6r6r7test_option_typeps   z$CommandLineTestCase.test_option_typecCs<|dd}tjj}|d|||d|dS)Nr4rzCalendar for %ss3Januaryrrr6r6r7test_html_output_current_yearzs  z1CommandLineTestCase.test_html_output_current_yearcCs4|ddddd}||tjfitddS)Nrrr"rr)rrHrIrJrFrKrr6r6r7test_html_output_year_encodingsz2CommandLineTestCase.test_html_output_year_encodingcCs>|ddd|ddd|ddddd}|d|dS)Nrrz-cz--cssz custom.cssrs;r-rr6r6r7test_html_output_year_csss z-CommandLineTestCase.test_html_output_year_cssN)rrrrrrrrr r!r#r,r.r0r2r3r6r7r8r9r6r6r6r7r s" r c@seZdZddZdS) MiscTestCasecCshd}tj|t|ddS)N>mainZTUESDAYZJanuaryZ formatstringZmdaysrZTHURSDAYZ prevmonthrZEPOCHZmonthlenrr5ZFRIDAYZSATURDAYrJZ nextmonthZ WEDNESDAYZdifferent_localerZFebruary) blacklist)rZ check__all__rD)r=r<r6r6r7 test__all__szMiscTestCase.test__all__N)rrrr=r6r6r6r7r:sr:c@sDeZdZddZddZddZddZd d Zd d Zd dZ dS)TestSubClassingCasecCsGdddtj}||_dS)Nc@s6eZdZddejjDZgdZdZdZdZ dZ dS) z0TestSubClassingCase.setUp..CustomHTMLCalcSsg|] }|dqS)z text-nowrapr6)rcstyler6r6r7rhrz;TestSubClassingCase.setUp..CustomHTMLCal.)ZredZblueZgreenZlilacZyellowZorangeZpinkztext-center month-headztext-center monthz text-italic zlead N) rrrrDrEZ cssclassescssclasses_weekday_headZcssclass_month_headZcssclass_month cssclass_yearcssclass_year_headr6r6r6r7 CustomHTMLCalsrC)rDrErM)r=rCr6r6r7rs zTestSubClassingCase.setUpcCs|d|jdddS)Nzclass="text-center month-head"rr )rrMr|rSr6r6r7test_formatmonthnames z(TestSubClassingCase.test_formatmonthnamecCs|d|jdddS)Nzclass="text-center month"rr )rrMrvrSr6r6r7rys z$TestSubClassingCase.test_formatmonthcCs*|jdd}|d|j|ddS)Nrr zclass="wed text-nowrap"r)rMZmonthdays2calendarrZ formatweek)r=rr6r6r7test_formatweeksz#TestSubClassingCase.test_formatweekcCs,|j}|jjD]}|d||qdS)Nz)rMrsr@r)r=headerZcolorr6r6r7test_formatweek_heads  z(TestSubClassingCase.test_formatweek_headcCs |d|jj|jddS)Nz=r)rrMrArVrSr6r6r7test_format_years  z$TestSubClassingCase.test_format_yearcCs&|dd|jjdf|jddS)Nz,r r)rrMrBrVrSr6r6r7test_format_year_heads   z)TestSubClassingCase.test_format_year_headN) rrrrrDryrErGrHrIr6r6r6r7r>sr>__main__)$rDrtestrZtest.support.script_helperrrrrr[rr rxrRrwrQdictrFrIrprmZTestCaser1rrrrrrrr r r:r>rr;r6r6r6r7s  ' '~BA|k:9w * 
%s