Fred Drake | d077ca1 | 2001-12-12 05:38:08 +0000 | [diff] [blame] | 1 | import calendar |
| 2 | import unittest |
| 3 | |
Benjamin Peterson | ee8712c | 2008-05-20 21:35:26 +0000 | [diff] [blame] | 4 | from test import support |
Alexander Belopolsky | 43ca710 | 2010-06-14 17:32:03 +0000 | [diff] [blame] | 5 | import time |
Georg Brandl | 7004bd1 | 2010-10-19 18:54:25 +0000 | [diff] [blame] | 6 | import locale |
Fred Drake | d077ca1 | 2001-12-12 05:38:08 +0000 | [diff] [blame] | 7 | |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 8 | result_2004_text = """ |
| 9 | 2004 |
| 10 | |
| 11 | January February March |
| 12 | Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su |
| 13 | 1 2 3 4 1 1 2 3 4 5 6 7 |
| 14 | 5 6 7 8 9 10 11 2 3 4 5 6 7 8 8 9 10 11 12 13 14 |
| 15 | 12 13 14 15 16 17 18 9 10 11 12 13 14 15 15 16 17 18 19 20 21 |
| 16 | 19 20 21 22 23 24 25 16 17 18 19 20 21 22 22 23 24 25 26 27 28 |
| 17 | 26 27 28 29 30 31 23 24 25 26 27 28 29 29 30 31 |
| 18 | |
| 19 | April May June |
| 20 | Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su |
| 21 | 1 2 3 4 1 2 1 2 3 4 5 6 |
| 22 | 5 6 7 8 9 10 11 3 4 5 6 7 8 9 7 8 9 10 11 12 13 |
| 23 | 12 13 14 15 16 17 18 10 11 12 13 14 15 16 14 15 16 17 18 19 20 |
| 24 | 19 20 21 22 23 24 25 17 18 19 20 21 22 23 21 22 23 24 25 26 27 |
| 25 | 26 27 28 29 30 24 25 26 27 28 29 30 28 29 30 |
| 26 | 31 |
| 27 | |
| 28 | July August September |
| 29 | Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su |
| 30 | 1 2 3 4 1 1 2 3 4 5 |
| 31 | 5 6 7 8 9 10 11 2 3 4 5 6 7 8 6 7 8 9 10 11 12 |
| 32 | 12 13 14 15 16 17 18 9 10 11 12 13 14 15 13 14 15 16 17 18 19 |
| 33 | 19 20 21 22 23 24 25 16 17 18 19 20 21 22 20 21 22 23 24 25 26 |
| 34 | 26 27 28 29 30 31 23 24 25 26 27 28 29 27 28 29 30 |
| 35 | 30 31 |
| 36 | |
| 37 | October November December |
| 38 | Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su |
| 39 | 1 2 3 1 2 3 4 5 6 7 1 2 3 4 5 |
| 40 | 4 5 6 7 8 9 10 8 9 10 11 12 13 14 6 7 8 9 10 11 12 |
| 41 | 11 12 13 14 15 16 17 15 16 17 18 19 20 21 13 14 15 16 17 18 19 |
| 42 | 18 19 20 21 22 23 24 22 23 24 25 26 27 28 20 21 22 23 24 25 26 |
| 43 | 25 26 27 28 29 30 31 29 30 27 28 29 30 31 |
| 44 | """ |
| 45 | |
| 46 | result_2004_html = """ |
| 47 | <?xml version="1.0" encoding="ascii"?> |
| 48 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
| 49 | <html> |
| 50 | <head> |
| 51 | <meta http-equiv="Content-Type" content="text/html; charset=ascii" /> |
| 52 | <link rel="stylesheet" type="text/css" href="calendar.css" /> |
Thomas Wouters | 47b49bf | 2007-08-30 22:15:33 +0000 | [diff] [blame] | 53 | <title>Calendar for 2004</title> |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 54 | </head> |
| 55 | <body> |
| 56 | <table border="0" cellpadding="0" cellspacing="0" class="year"> |
| 57 | <tr><th colspan="3" class="year">2004</th></tr><tr><td><table border="0" cellpadding="0" cellspacing="0" class="month"> |
| 58 | <tr><th colspan="7" class="month">January</th></tr> |
| 59 | <tr><th class="mon">Mon</th><th class="tue">Tue</th><th class="wed">Wed</th><th class="thu">Thu</th><th class="fri">Fri</th><th class="sat">Sat</th><th class="sun">Sun</th></tr> |
| 60 | <tr><td class="noday"> </td><td class="noday"> </td><td class="noday"> </td><td class="thu">1</td><td class="fri">2</td><td class="sat">3</td><td class="sun">4</td></tr> |
| 61 | <tr><td class="mon">5</td><td class="tue">6</td><td class="wed">7</td><td class="thu">8</td><td class="fri">9</td><td class="sat">10</td><td class="sun">11</td></tr> |
| 62 | <tr><td class="mon">12</td><td class="tue">13</td><td class="wed">14</td><td class="thu">15</td><td class="fri">16</td><td class="sat">17</td><td class="sun">18</td></tr> |
| 63 | <tr><td class="mon">19</td><td class="tue">20</td><td class="wed">21</td><td class="thu">22</td><td class="fri">23</td><td class="sat">24</td><td class="sun">25</td></tr> |
| 64 | <tr><td class="mon">26</td><td class="tue">27</td><td class="wed">28</td><td class="thu">29</td><td class="fri">30</td><td class="sat">31</td><td class="noday"> </td></tr> |
| 65 | </table> |
| 66 | </td><td><table border="0" cellpadding="0" cellspacing="0" class="month"> |
| 67 | <tr><th colspan="7" class="month">February</th></tr> |
| 68 | <tr><th class="mon">Mon</th><th class="tue">Tue</th><th class="wed">Wed</th><th class="thu">Thu</th><th class="fri">Fri</th><th class="sat">Sat</th><th class="sun">Sun</th></tr> |
| 69 | <tr><td class="noday"> </td><td class="noday"> </td><td class="noday"> </td><td class="noday"> </td><td class="noday"> </td><td class="noday"> </td><td class="sun">1</td></tr> |
| 70 | <tr><td class="mon">2</td><td class="tue">3</td><td class="wed">4</td><td class="thu">5</td><td class="fri">6</td><td class="sat">7</td><td class="sun">8</td></tr> |
| 71 | <tr><td class="mon">9</td><td class="tue">10</td><td class="wed">11</td><td class="thu">12</td><td class="fri">13</td><td class="sat">14</td><td class="sun">15</td></tr> |
| 72 | <tr><td class="mon">16</td><td class="tue">17</td><td class="wed">18</td><td class="thu">19</td><td class="fri">20</td><td class="sat">21</td><td class="sun">22</td></tr> |
| 73 | <tr><td class="mon">23</td><td class="tue">24</td><td class="wed">25</td><td class="thu">26</td><td class="fri">27</td><td class="sat">28</td><td class="sun">29</td></tr> |
| 74 | </table> |
| 75 | </td><td><table border="0" cellpadding="0" cellspacing="0" class="month"> |
| 76 | <tr><th colspan="7" class="month">March</th></tr> |
| 77 | <tr><th class="mon">Mon</th><th class="tue">Tue</th><th class="wed">Wed</th><th class="thu">Thu</th><th class="fri">Fri</th><th class="sat">Sat</th><th class="sun">Sun</th></tr> |
| 78 | <tr><td class="mon">1</td><td class="tue">2</td><td class="wed">3</td><td class="thu">4</td><td class="fri">5</td><td class="sat">6</td><td class="sun">7</td></tr> |
| 79 | <tr><td class="mon">8</td><td class="tue">9</td><td class="wed">10</td><td class="thu">11</td><td class="fri">12</td><td class="sat">13</td><td class="sun">14</td></tr> |
| 80 | <tr><td class="mon">15</td><td class="tue">16</td><td class="wed">17</td><td class="thu">18</td><td class="fri">19</td><td class="sat">20</td><td class="sun">21</td></tr> |
| 81 | <tr><td class="mon">22</td><td class="tue">23</td><td class="wed">24</td><td class="thu">25</td><td class="fri">26</td><td class="sat">27</td><td class="sun">28</td></tr> |
| 82 | <tr><td class="mon">29</td><td class="tue">30</td><td class="wed">31</td><td class="noday"> </td><td class="noday"> </td><td class="noday"> </td><td class="noday"> </td></tr> |
| 83 | </table> |
| 84 | </td></tr><tr><td><table border="0" cellpadding="0" cellspacing="0" class="month"> |
| 85 | <tr><th colspan="7" class="month">April</th></tr> |
| 86 | <tr><th class="mon">Mon</th><th class="tue">Tue</th><th class="wed">Wed</th><th class="thu">Thu</th><th class="fri">Fri</th><th class="sat">Sat</th><th class="sun">Sun</th></tr> |
| 87 | <tr><td class="noday"> </td><td class="noday"> </td><td class="noday"> </td><td class="thu">1</td><td class="fri">2</td><td class="sat">3</td><td class="sun">4</td></tr> |
| 88 | <tr><td class="mon">5</td><td class="tue">6</td><td class="wed">7</td><td class="thu">8</td><td class="fri">9</td><td class="sat">10</td><td class="sun">11</td></tr> |
| 89 | <tr><td class="mon">12</td><td class="tue">13</td><td class="wed">14</td><td class="thu">15</td><td class="fri">16</td><td class="sat">17</td><td class="sun">18</td></tr> |
| 90 | <tr><td class="mon">19</td><td class="tue">20</td><td class="wed">21</td><td class="thu">22</td><td class="fri">23</td><td class="sat">24</td><td class="sun">25</td></tr> |
| 91 | <tr><td class="mon">26</td><td class="tue">27</td><td class="wed">28</td><td class="thu">29</td><td class="fri">30</td><td class="noday"> </td><td class="noday"> </td></tr> |
| 92 | </table> |
| 93 | </td><td><table border="0" cellpadding="0" cellspacing="0" class="month"> |
| 94 | <tr><th colspan="7" class="month">May</th></tr> |
| 95 | <tr><th class="mon">Mon</th><th class="tue">Tue</th><th class="wed">Wed</th><th class="thu">Thu</th><th class="fri">Fri</th><th class="sat">Sat</th><th class="sun">Sun</th></tr> |
| 96 | <tr><td class="noday"> </td><td class="noday"> </td><td class="noday"> </td><td class="noday"> </td><td class="noday"> </td><td class="sat">1</td><td class="sun">2</td></tr> |
| 97 | <tr><td class="mon">3</td><td class="tue">4</td><td class="wed">5</td><td class="thu">6</td><td class="fri">7</td><td class="sat">8</td><td class="sun">9</td></tr> |
| 98 | <tr><td class="mon">10</td><td class="tue">11</td><td class="wed">12</td><td class="thu">13</td><td class="fri">14</td><td class="sat">15</td><td class="sun">16</td></tr> |
| 99 | <tr><td class="mon">17</td><td class="tue">18</td><td class="wed">19</td><td class="thu">20</td><td class="fri">21</td><td class="sat">22</td><td class="sun">23</td></tr> |
| 100 | <tr><td class="mon">24</td><td class="tue">25</td><td class="wed">26</td><td class="thu">27</td><td class="fri">28</td><td class="sat">29</td><td class="sun">30</td></tr> |
| 101 | <tr><td class="mon">31</td><td class="noday"> </td><td class="noday"> </td><td class="noday"> </td><td class="noday"> </td><td class="noday"> </td><td class="noday"> </td></tr> |
| 102 | </table> |
| 103 | </td><td><table border="0" cellpadding="0" cellspacing="0" class="month"> |
| 104 | <tr><th colspan="7" class="month">June</th></tr> |
| 105 | <tr><th class="mon">Mon</th><th class="tue">Tue</th><th class="wed">Wed</th><th class="thu">Thu</th><th class="fri">Fri</th><th class="sat">Sat</th><th class="sun">Sun</th></tr> |
| 106 | <tr><td class="noday"> </td><td class="tue">1</td><td class="wed">2</td><td class="thu">3</td><td class="fri">4</td><td class="sat">5</td><td class="sun">6</td></tr> |
| 107 | <tr><td class="mon">7</td><td class="tue">8</td><td class="wed">9</td><td class="thu">10</td><td class="fri">11</td><td class="sat">12</td><td class="sun">13</td></tr> |
| 108 | <tr><td class="mon">14</td><td class="tue">15</td><td class="wed">16</td><td class="thu">17</td><td class="fri">18</td><td class="sat">19</td><td class="sun">20</td></tr> |
| 109 | <tr><td class="mon">21</td><td class="tue">22</td><td class="wed">23</td><td class="thu">24</td><td class="fri">25</td><td class="sat">26</td><td class="sun">27</td></tr> |
| 110 | <tr><td class="mon">28</td><td class="tue">29</td><td class="wed">30</td><td class="noday"> </td><td class="noday"> </td><td class="noday"> </td><td class="noday"> </td></tr> |
| 111 | </table> |
| 112 | </td></tr><tr><td><table border="0" cellpadding="0" cellspacing="0" class="month"> |
| 113 | <tr><th colspan="7" class="month">July</th></tr> |
| 114 | <tr><th class="mon">Mon</th><th class="tue">Tue</th><th class="wed">Wed</th><th class="thu">Thu</th><th class="fri">Fri</th><th class="sat">Sat</th><th class="sun">Sun</th></tr> |
| 115 | <tr><td class="noday"> </td><td class="noday"> </td><td class="noday"> </td><td class="thu">1</td><td class="fri">2</td><td class="sat">3</td><td class="sun">4</td></tr> |
| 116 | <tr><td class="mon">5</td><td class="tue">6</td><td class="wed">7</td><td class="thu">8</td><td class="fri">9</td><td class="sat">10</td><td class="sun">11</td></tr> |
| 117 | <tr><td class="mon">12</td><td class="tue">13</td><td class="wed">14</td><td class="thu">15</td><td class="fri">16</td><td class="sat">17</td><td class="sun">18</td></tr> |
| 118 | <tr><td class="mon">19</td><td class="tue">20</td><td class="wed">21</td><td class="thu">22</td><td class="fri">23</td><td class="sat">24</td><td class="sun">25</td></tr> |
| 119 | <tr><td class="mon">26</td><td class="tue">27</td><td class="wed">28</td><td class="thu">29</td><td class="fri">30</td><td class="sat">31</td><td class="noday"> </td></tr> |
| 120 | </table> |
| 121 | </td><td><table border="0" cellpadding="0" cellspacing="0" class="month"> |
| 122 | <tr><th colspan="7" class="month">August</th></tr> |
| 123 | <tr><th class="mon">Mon</th><th class="tue">Tue</th><th class="wed">Wed</th><th class="thu">Thu</th><th class="fri">Fri</th><th class="sat">Sat</th><th class="sun">Sun</th></tr> |
| 124 | <tr><td class="noday"> </td><td class="noday"> </td><td class="noday"> </td><td class="noday"> </td><td class="noday"> </td><td class="noday"> </td><td class="sun">1</td></tr> |
| 125 | <tr><td class="mon">2</td><td class="tue">3</td><td class="wed">4</td><td class="thu">5</td><td class="fri">6</td><td class="sat">7</td><td class="sun">8</td></tr> |
| 126 | <tr><td class="mon">9</td><td class="tue">10</td><td class="wed">11</td><td class="thu">12</td><td class="fri">13</td><td class="sat">14</td><td class="sun">15</td></tr> |
| 127 | <tr><td class="mon">16</td><td class="tue">17</td><td class="wed">18</td><td class="thu">19</td><td class="fri">20</td><td class="sat">21</td><td class="sun">22</td></tr> |
| 128 | <tr><td class="mon">23</td><td class="tue">24</td><td class="wed">25</td><td class="thu">26</td><td class="fri">27</td><td class="sat">28</td><td class="sun">29</td></tr> |
| 129 | <tr><td class="mon">30</td><td class="tue">31</td><td class="noday"> </td><td class="noday"> </td><td class="noday"> </td><td class="noday"> </td><td class="noday"> </td></tr> |
| 130 | </table> |
| 131 | </td><td><table border="0" cellpadding="0" cellspacing="0" class="month"> |
| 132 | <tr><th colspan="7" class="month">September</th></tr> |
| 133 | <tr><th class="mon">Mon</th><th class="tue">Tue</th><th class="wed">Wed</th><th class="thu">Thu</th><th class="fri">Fri</th><th class="sat">Sat</th><th class="sun">Sun</th></tr> |
| 134 | <tr><td class="noday"> </td><td class="noday"> </td><td class="wed">1</td><td class="thu">2</td><td class="fri">3</td><td class="sat">4</td><td class="sun">5</td></tr> |
| 135 | <tr><td class="mon">6</td><td class="tue">7</td><td class="wed">8</td><td class="thu">9</td><td class="fri">10</td><td class="sat">11</td><td class="sun">12</td></tr> |
| 136 | <tr><td class="mon">13</td><td class="tue">14</td><td class="wed">15</td><td class="thu">16</td><td class="fri">17</td><td class="sat">18</td><td class="sun">19</td></tr> |
| 137 | <tr><td class="mon">20</td><td class="tue">21</td><td class="wed">22</td><td class="thu">23</td><td class="fri">24</td><td class="sat">25</td><td class="sun">26</td></tr> |
| 138 | <tr><td class="mon">27</td><td class="tue">28</td><td class="wed">29</td><td class="thu">30</td><td class="noday"> </td><td class="noday"> </td><td class="noday"> </td></tr> |
| 139 | </table> |
| 140 | </td></tr><tr><td><table border="0" cellpadding="0" cellspacing="0" class="month"> |
| 141 | <tr><th colspan="7" class="month">October</th></tr> |
| 142 | <tr><th class="mon">Mon</th><th class="tue">Tue</th><th class="wed">Wed</th><th class="thu">Thu</th><th class="fri">Fri</th><th class="sat">Sat</th><th class="sun">Sun</th></tr> |
| 143 | <tr><td class="noday"> </td><td class="noday"> </td><td class="noday"> </td><td class="noday"> </td><td class="fri">1</td><td class="sat">2</td><td class="sun">3</td></tr> |
| 144 | <tr><td class="mon">4</td><td class="tue">5</td><td class="wed">6</td><td class="thu">7</td><td class="fri">8</td><td class="sat">9</td><td class="sun">10</td></tr> |
| 145 | <tr><td class="mon">11</td><td class="tue">12</td><td class="wed">13</td><td class="thu">14</td><td class="fri">15</td><td class="sat">16</td><td class="sun">17</td></tr> |
| 146 | <tr><td class="mon">18</td><td class="tue">19</td><td class="wed">20</td><td class="thu">21</td><td class="fri">22</td><td class="sat">23</td><td class="sun">24</td></tr> |
| 147 | <tr><td class="mon">25</td><td class="tue">26</td><td class="wed">27</td><td class="thu">28</td><td class="fri">29</td><td class="sat">30</td><td class="sun">31</td></tr> |
| 148 | </table> |
| 149 | </td><td><table border="0" cellpadding="0" cellspacing="0" class="month"> |
| 150 | <tr><th colspan="7" class="month">November</th></tr> |
| 151 | <tr><th class="mon">Mon</th><th class="tue">Tue</th><th class="wed">Wed</th><th class="thu">Thu</th><th class="fri">Fri</th><th class="sat">Sat</th><th class="sun">Sun</th></tr> |
| 152 | <tr><td class="mon">1</td><td class="tue">2</td><td class="wed">3</td><td class="thu">4</td><td class="fri">5</td><td class="sat">6</td><td class="sun">7</td></tr> |
| 153 | <tr><td class="mon">8</td><td class="tue">9</td><td class="wed">10</td><td class="thu">11</td><td class="fri">12</td><td class="sat">13</td><td class="sun">14</td></tr> |
| 154 | <tr><td class="mon">15</td><td class="tue">16</td><td class="wed">17</td><td class="thu">18</td><td class="fri">19</td><td class="sat">20</td><td class="sun">21</td></tr> |
| 155 | <tr><td class="mon">22</td><td class="tue">23</td><td class="wed">24</td><td class="thu">25</td><td class="fri">26</td><td class="sat">27</td><td class="sun">28</td></tr> |
| 156 | <tr><td class="mon">29</td><td class="tue">30</td><td class="noday"> </td><td class="noday"> </td><td class="noday"> </td><td class="noday"> </td><td class="noday"> </td></tr> |
| 157 | </table> |
| 158 | </td><td><table border="0" cellpadding="0" cellspacing="0" class="month"> |
| 159 | <tr><th colspan="7" class="month">December</th></tr> |
| 160 | <tr><th class="mon">Mon</th><th class="tue">Tue</th><th class="wed">Wed</th><th class="thu">Thu</th><th class="fri">Fri</th><th class="sat">Sat</th><th class="sun">Sun</th></tr> |
| 161 | <tr><td class="noday"> </td><td class="noday"> </td><td class="wed">1</td><td class="thu">2</td><td class="fri">3</td><td class="sat">4</td><td class="sun">5</td></tr> |
| 162 | <tr><td class="mon">6</td><td class="tue">7</td><td class="wed">8</td><td class="thu">9</td><td class="fri">10</td><td class="sat">11</td><td class="sun">12</td></tr> |
| 163 | <tr><td class="mon">13</td><td class="tue">14</td><td class="wed">15</td><td class="thu">16</td><td class="fri">17</td><td class="sat">18</td><td class="sun">19</td></tr> |
| 164 | <tr><td class="mon">20</td><td class="tue">21</td><td class="wed">22</td><td class="thu">23</td><td class="fri">24</td><td class="sat">25</td><td class="sun">26</td></tr> |
| 165 | <tr><td class="mon">27</td><td class="tue">28</td><td class="wed">29</td><td class="thu">30</td><td class="fri">31</td><td class="noday"> </td><td class="noday"> </td></tr> |
| 166 | </table> |
| 167 | </td></tr></table></body> |
| 168 | </html> |
| 169 | """ |
| 170 | |
| 171 | |
| 172 | class OutputTestCase(unittest.TestCase): |
| 173 | def normalize_calendar(self, s): |
Mark Dickinson | 934896d | 2009-02-21 20:59:32 +0000 | [diff] [blame] | 174 | # Filters out locale dependent strings |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 175 | def neitherspacenordigit(c): |
| 176 | return not c.isspace() and not c.isdigit() |
| 177 | |
| 178 | lines = [] |
| 179 | for line in s.splitlines(False): |
| 180 | # Drop texts, as they are locale dependent |
| 181 | if line and not filter(neitherspacenordigit, line): |
| 182 | lines.append(line) |
| 183 | return lines |
| 184 | |
| 185 | def test_output(self): |
| 186 | self.assertEqual( |
| 187 | self.normalize_calendar(calendar.calendar(2004)), |
| 188 | self.normalize_calendar(result_2004_text) |
| 189 | ) |
| 190 | |
| 191 | def test_output_textcalendar(self): |
| 192 | self.assertEqual( |
| 193 | calendar.TextCalendar().formatyear(2004).strip(), |
| 194 | result_2004_text.strip() |
| 195 | ) |
| 196 | |
| 197 | def test_output_htmlcalendar(self): |
Walter Dörwald | c49ebc0 | 2007-05-22 17:03:39 +0000 | [diff] [blame] | 198 | encoding = 'ascii' |
| 199 | cal = calendar.HTMLCalendar() |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 200 | self.assertEqual( |
Walter Dörwald | c49ebc0 | 2007-05-22 17:03:39 +0000 | [diff] [blame] | 201 | cal.formatyearpage(2004, encoding=encoding).strip(b' \t\n'), |
| 202 | result_2004_html.strip(' \t\n').encode(encoding) |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 203 | ) |
| 204 | |
| 205 | |
Fred Drake | d077ca1 | 2001-12-12 05:38:08 +0000 | [diff] [blame] | 206 | class CalendarTestCase(unittest.TestCase): |
| 207 | def test_isleap(self): |
| 208 | # Make sure that the return is right for a few years, and |
| 209 | # ensure that the return values are 1 or 0, not just true or |
| 210 | # false (see SF bug #485794). Specific additional tests may |
| 211 | # be appropriate; this tests a single "cycle". |
| 212 | self.assertEqual(calendar.isleap(2000), 1) |
| 213 | self.assertEqual(calendar.isleap(2001), 0) |
| 214 | self.assertEqual(calendar.isleap(2002), 0) |
| 215 | self.assertEqual(calendar.isleap(2003), 0) |
| 216 | |
| 217 | def test_setfirstweekday(self): |
Guido van Rossum | 47b9ff6 | 2006-08-24 00:41:19 +0000 | [diff] [blame] | 218 | self.assertRaises(TypeError, calendar.setfirstweekday, 'flabber') |
Fred Drake | d077ca1 | 2001-12-12 05:38:08 +0000 | [diff] [blame] | 219 | self.assertRaises(ValueError, calendar.setfirstweekday, -1) |
| 220 | self.assertRaises(ValueError, calendar.setfirstweekday, 200) |
| 221 | orig = calendar.firstweekday() |
| 222 | calendar.setfirstweekday(calendar.SUNDAY) |
| 223 | self.assertEqual(calendar.firstweekday(), calendar.SUNDAY) |
| 224 | calendar.setfirstweekday(calendar.MONDAY) |
| 225 | self.assertEqual(calendar.firstweekday(), calendar.MONDAY) |
| 226 | calendar.setfirstweekday(orig) |
| 227 | |
Skip Montanaro | 693c6c4 | 2002-03-15 03:57:04 +0000 | [diff] [blame] | 228 | def test_enumerateweekdays(self): |
| 229 | self.assertRaises(IndexError, calendar.day_abbr.__getitem__, -10) |
| 230 | self.assertRaises(IndexError, calendar.day_name.__getitem__, 10) |
| 231 | self.assertEqual(len([d for d in calendar.day_abbr]), 7) |
Fred Drake | d077ca1 | 2001-12-12 05:38:08 +0000 | [diff] [blame] | 232 | |
Tim Peters | 0c2c8e7 | 2002-03-23 03:26:53 +0000 | [diff] [blame] | 233 | def test_days(self): |
| 234 | for attr in "day_name", "day_abbr": |
| 235 | value = getattr(calendar, attr) |
| 236 | self.assertEqual(len(value), 7) |
| 237 | self.assertEqual(len(value[:]), 7) |
| 238 | # ensure they're all unique |
Tim Peters | bbc0d44 | 2004-11-13 16:18:32 +0000 | [diff] [blame] | 239 | self.assertEqual(len(set(value)), 7) |
| 240 | # verify it "acts like a sequence" in two forms of iteration |
| 241 | self.assertEqual(value[::-1], list(reversed(value))) |
Tim Peters | 0c2c8e7 | 2002-03-23 03:26:53 +0000 | [diff] [blame] | 242 | |
| 243 | def test_months(self): |
| 244 | for attr in "month_name", "month_abbr": |
| 245 | value = getattr(calendar, attr) |
| 246 | self.assertEqual(len(value), 13) |
| 247 | self.assertEqual(len(value[:]), 13) |
| 248 | self.assertEqual(value[0], "") |
| 249 | # ensure they're all unique |
Tim Peters | bbc0d44 | 2004-11-13 16:18:32 +0000 | [diff] [blame] | 250 | self.assertEqual(len(set(value)), 13) |
| 251 | # verify it "acts like a sequence" in two forms of iteration |
| 252 | self.assertEqual(value[::-1], list(reversed(value))) |
Tim Peters | 0c2c8e7 | 2002-03-23 03:26:53 +0000 | [diff] [blame] | 253 | |
Georg Brandl | 7004bd1 | 2010-10-19 18:54:25 +0000 | [diff] [blame] | 254 | def test_localecalendars(self): |
| 255 | # ensure that Locale{Text,HTML}Calendar resets the locale properly |
| 256 | # (it is still not thread-safe though) |
Georg Brandl | 7004bd1 | 2010-10-19 18:54:25 +0000 | [diff] [blame] | 257 | old_october = calendar.TextCalendar().formatmonthname(2010, 10, 10) |
Georg Brandl | 9450cc0 | 2010-10-20 06:50:19 +0000 | [diff] [blame] | 258 | try: |
| 259 | calendar.LocaleTextCalendar(locale='').formatmonthname(2010, 10, 10) |
| 260 | except locale.Error: |
| 261 | # cannot set the system default locale -- skip rest of test |
| 262 | return |
| 263 | calendar.LocaleHTMLCalendar(locale='').formatmonthname(2010, 10) |
Georg Brandl | 7004bd1 | 2010-10-19 18:54:25 +0000 | [diff] [blame] | 264 | new_october = calendar.TextCalendar().formatmonthname(2010, 10, 10) |
Ezio Melotti | b3aedd4 | 2010-11-20 19:04:17 +0000 | [diff] [blame] | 265 | self.assertEqual(old_october, new_october) |
Georg Brandl | 7004bd1 | 2010-10-19 18:54:25 +0000 | [diff] [blame] | 266 | |
Walter Dörwald | 59ad456 | 2004-07-02 19:00:09 +0000 | [diff] [blame] | 267 | |
| 268 | class MonthCalendarTestCase(unittest.TestCase): |
| 269 | def setUp(self): |
| 270 | self.oldfirstweekday = calendar.firstweekday() |
| 271 | calendar.setfirstweekday(self.firstweekday) |
| 272 | |
| 273 | def tearDown(self): |
| 274 | calendar.setfirstweekday(self.oldfirstweekday) |
| 275 | |
| 276 | def check_weeks(self, year, month, weeks): |
| 277 | cal = calendar.monthcalendar(year, month) |
| 278 | self.assertEqual(len(cal), len(weeks)) |
Guido van Rossum | 805365e | 2007-05-07 22:24:25 +0000 | [diff] [blame] | 279 | for i in range(len(weeks)): |
Walter Dörwald | 59ad456 | 2004-07-02 19:00:09 +0000 | [diff] [blame] | 280 | self.assertEqual(weeks[i], sum(day != 0 for day in cal[i])) |
| 281 | |
| 282 | |
| 283 | class MondayTestCase(MonthCalendarTestCase): |
| 284 | firstweekday = calendar.MONDAY |
| 285 | |
| 286 | def test_february(self): |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 287 | # A 28-day february starting on monday (7+7+7+7 days) |
Walter Dörwald | 59ad456 | 2004-07-02 19:00:09 +0000 | [diff] [blame] | 288 | self.check_weeks(1999, 2, (7, 7, 7, 7)) |
| 289 | |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 290 | # A 28-day february starting on tuesday (6+7+7+7+1 days) |
Walter Dörwald | 59ad456 | 2004-07-02 19:00:09 +0000 | [diff] [blame] | 291 | self.check_weeks(2005, 2, (6, 7, 7, 7, 1)) |
| 292 | |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 293 | # A 28-day february starting on sunday (1+7+7+7+6 days) |
Walter Dörwald | 59ad456 | 2004-07-02 19:00:09 +0000 | [diff] [blame] | 294 | self.check_weeks(1987, 2, (1, 7, 7, 7, 6)) |
| 295 | |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 296 | # A 29-day february starting on monday (7+7+7+7+1 days) |
Walter Dörwald | 59ad456 | 2004-07-02 19:00:09 +0000 | [diff] [blame] | 297 | self.check_weeks(1988, 2, (7, 7, 7, 7, 1)) |
| 298 | |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 299 | # A 29-day february starting on tuesday (6+7+7+7+2 days) |
Walter Dörwald | 59ad456 | 2004-07-02 19:00:09 +0000 | [diff] [blame] | 300 | self.check_weeks(1972, 2, (6, 7, 7, 7, 2)) |
| 301 | |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 302 | # A 29-day february starting on sunday (1+7+7+7+7 days) |
Walter Dörwald | 59ad456 | 2004-07-02 19:00:09 +0000 | [diff] [blame] | 303 | self.check_weeks(2004, 2, (1, 7, 7, 7, 7)) |
| 304 | |
| 305 | def test_april(self): |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 306 | # A 30-day april starting on monday (7+7+7+7+2 days) |
Walter Dörwald | 59ad456 | 2004-07-02 19:00:09 +0000 | [diff] [blame] | 307 | self.check_weeks(1935, 4, (7, 7, 7, 7, 2)) |
| 308 | |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 309 | # A 30-day april starting on tuesday (6+7+7+7+3 days) |
Walter Dörwald | 59ad456 | 2004-07-02 19:00:09 +0000 | [diff] [blame] | 310 | self.check_weeks(1975, 4, (6, 7, 7, 7, 3)) |
| 311 | |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 312 | # A 30-day april starting on sunday (1+7+7+7+7+1 days) |
Walter Dörwald | 59ad456 | 2004-07-02 19:00:09 +0000 | [diff] [blame] | 313 | self.check_weeks(1945, 4, (1, 7, 7, 7, 7, 1)) |
| 314 | |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 315 | # A 30-day april starting on saturday (2+7+7+7+7 days) |
Walter Dörwald | 59ad456 | 2004-07-02 19:00:09 +0000 | [diff] [blame] | 316 | self.check_weeks(1995, 4, (2, 7, 7, 7, 7)) |
| 317 | |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 318 | # A 30-day april starting on friday (3+7+7+7+6 days) |
Walter Dörwald | 59ad456 | 2004-07-02 19:00:09 +0000 | [diff] [blame] | 319 | self.check_weeks(1994, 4, (3, 7, 7, 7, 6)) |
| 320 | |
| 321 | def test_december(self): |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 322 | # A 31-day december starting on monday (7+7+7+7+3 days) |
Walter Dörwald | 59ad456 | 2004-07-02 19:00:09 +0000 | [diff] [blame] | 323 | self.check_weeks(1980, 12, (7, 7, 7, 7, 3)) |
| 324 | |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 325 | # A 31-day december starting on tuesday (6+7+7+7+4 days) |
Walter Dörwald | 59ad456 | 2004-07-02 19:00:09 +0000 | [diff] [blame] | 326 | self.check_weeks(1987, 12, (6, 7, 7, 7, 4)) |
| 327 | |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 328 | # A 31-day december starting on sunday (1+7+7+7+7+2 days) |
Walter Dörwald | 59ad456 | 2004-07-02 19:00:09 +0000 | [diff] [blame] | 329 | self.check_weeks(1968, 12, (1, 7, 7, 7, 7, 2)) |
| 330 | |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 331 | # A 31-day december starting on thursday (4+7+7+7+6 days) |
Walter Dörwald | 59ad456 | 2004-07-02 19:00:09 +0000 | [diff] [blame] | 332 | self.check_weeks(1988, 12, (4, 7, 7, 7, 6)) |
| 333 | |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 334 | # A 31-day december starting on friday (3+7+7+7+7 days) |
Walter Dörwald | 59ad456 | 2004-07-02 19:00:09 +0000 | [diff] [blame] | 335 | self.check_weeks(2017, 12, (3, 7, 7, 7, 7)) |
| 336 | |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 337 | # A 31-day december starting on saturday (2+7+7+7+7+1 days) |
Walter Dörwald | 59ad456 | 2004-07-02 19:00:09 +0000 | [diff] [blame] | 338 | self.check_weeks(2068, 12, (2, 7, 7, 7, 7, 1)) |
| 339 | |
| 340 | |
Walter Dörwald | 302fa6d | 2004-07-08 17:14:17 +0000 | [diff] [blame] | 341 | class SundayTestCase(MonthCalendarTestCase): |
| 342 | firstweekday = calendar.SUNDAY |
| 343 | |
| 344 | def test_february(self): |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 345 | # A 28-day february starting on sunday (7+7+7+7 days) |
Walter Dörwald | 302fa6d | 2004-07-08 17:14:17 +0000 | [diff] [blame] | 346 | self.check_weeks(2009, 2, (7, 7, 7, 7)) |
| 347 | |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 348 | # A 28-day february starting on monday (6+7+7+7+1 days) |
Walter Dörwald | 302fa6d | 2004-07-08 17:14:17 +0000 | [diff] [blame] | 349 | self.check_weeks(1999, 2, (6, 7, 7, 7, 1)) |
| 350 | |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 351 | # A 28-day february starting on saturday (1+7+7+7+6 days) |
Walter Dörwald | 302fa6d | 2004-07-08 17:14:17 +0000 | [diff] [blame] | 352 | self.check_weeks(1997, 2, (1, 7, 7, 7, 6)) |
| 353 | |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 354 | # A 29-day february starting on sunday (7+7+7+7+1 days) |
Walter Dörwald | 302fa6d | 2004-07-08 17:14:17 +0000 | [diff] [blame] | 355 | self.check_weeks(2004, 2, (7, 7, 7, 7, 1)) |
| 356 | |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 357 | # A 29-day february starting on monday (6+7+7+7+2 days) |
Walter Dörwald | 302fa6d | 2004-07-08 17:14:17 +0000 | [diff] [blame] | 358 | self.check_weeks(1960, 2, (6, 7, 7, 7, 2)) |
| 359 | |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 360 | # A 29-day february starting on saturday (1+7+7+7+7 days) |
Walter Dörwald | 302fa6d | 2004-07-08 17:14:17 +0000 | [diff] [blame] | 361 | self.check_weeks(1964, 2, (1, 7, 7, 7, 7)) |
| 362 | |
| 363 | def test_april(self): |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 364 | # A 30-day april starting on sunday (7+7+7+7+2 days) |
Walter Dörwald | 302fa6d | 2004-07-08 17:14:17 +0000 | [diff] [blame] | 365 | self.check_weeks(1923, 4, (7, 7, 7, 7, 2)) |
| 366 | |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 367 | # A 30-day april starting on monday (6+7+7+7+3 days) |
Walter Dörwald | 302fa6d | 2004-07-08 17:14:17 +0000 | [diff] [blame] | 368 | self.check_weeks(1918, 4, (6, 7, 7, 7, 3)) |
| 369 | |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 370 | # A 30-day april starting on saturday (1+7+7+7+7+1 days) |
Walter Dörwald | 302fa6d | 2004-07-08 17:14:17 +0000 | [diff] [blame] | 371 | self.check_weeks(1950, 4, (1, 7, 7, 7, 7, 1)) |
| 372 | |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 373 | # A 30-day april starting on friday (2+7+7+7+7 days) |
Walter Dörwald | 302fa6d | 2004-07-08 17:14:17 +0000 | [diff] [blame] | 374 | self.check_weeks(1960, 4, (2, 7, 7, 7, 7)) |
| 375 | |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 376 | # A 30-day april starting on thursday (3+7+7+7+6 days) |
Walter Dörwald | 302fa6d | 2004-07-08 17:14:17 +0000 | [diff] [blame] | 377 | self.check_weeks(1909, 4, (3, 7, 7, 7, 6)) |
| 378 | |
| 379 | def test_december(self): |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 380 | # A 31-day december starting on sunday (7+7+7+7+3 days) |
Walter Dörwald | 302fa6d | 2004-07-08 17:14:17 +0000 | [diff] [blame] | 381 | self.check_weeks(2080, 12, (7, 7, 7, 7, 3)) |
| 382 | |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 383 | # A 31-day december starting on monday (6+7+7+7+4 days) |
Walter Dörwald | 302fa6d | 2004-07-08 17:14:17 +0000 | [diff] [blame] | 384 | self.check_weeks(1941, 12, (6, 7, 7, 7, 4)) |
| 385 | |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 386 | # A 31-day december starting on saturday (1+7+7+7+7+2 days) |
Walter Dörwald | 302fa6d | 2004-07-08 17:14:17 +0000 | [diff] [blame] | 387 | self.check_weeks(1923, 12, (1, 7, 7, 7, 7, 2)) |
| 388 | |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 389 | # A 31-day december starting on wednesday (4+7+7+7+6 days) |
Walter Dörwald | 302fa6d | 2004-07-08 17:14:17 +0000 | [diff] [blame] | 390 | self.check_weeks(1948, 12, (4, 7, 7, 7, 6)) |
| 391 | |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 392 | # A 31-day december starting on thursday (3+7+7+7+7 days) |
Walter Dörwald | 302fa6d | 2004-07-08 17:14:17 +0000 | [diff] [blame] | 393 | self.check_weeks(1927, 12, (3, 7, 7, 7, 7)) |
| 394 | |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 395 | # A 31-day december starting on friday (2+7+7+7+7+1 days) |
Walter Dörwald | 302fa6d | 2004-07-08 17:14:17 +0000 | [diff] [blame] | 396 | self.check_weeks(1995, 12, (2, 7, 7, 7, 7, 1)) |
| 397 | |
Alexander Belopolsky | 43ca710 | 2010-06-14 17:32:03 +0000 | [diff] [blame] | 398 | class TimegmTestCase(unittest.TestCase): |
| 399 | TIMESTAMPS = [0, 10, 100, 1000, 10000, 100000, 1000000, |
| 400 | 1234567890, 1262304000, 1275785153,] |
| 401 | def test_timegm(self): |
| 402 | for secs in self.TIMESTAMPS: |
| 403 | tuple = time.gmtime(secs) |
| 404 | self.assertEqual(secs, calendar.timegm(tuple)) |
Walter Dörwald | 302fa6d | 2004-07-08 17:14:17 +0000 | [diff] [blame] | 405 | |
Brett Cannon | cfae36f | 2010-07-23 13:54:14 +0000 | [diff] [blame] | 406 | class MonthRangeTestCase(unittest.TestCase): |
| 407 | def test_january(self): |
| 408 | # Tests valid lower boundary case. |
| 409 | self.assertEqual(calendar.monthrange(2004,1), (3,31)) |
| 410 | |
| 411 | def test_february_leap(self): |
| 412 | # Tests February during leap year. |
| 413 | self.assertEqual(calendar.monthrange(2004,2), (6,29)) |
| 414 | |
| 415 | def test_february_nonleap(self): |
| 416 | # Tests February in non-leap year. |
| 417 | self.assertEqual(calendar.monthrange(2010,2), (0,28)) |
| 418 | |
| 419 | def test_december(self): |
| 420 | # Tests valid upper boundary case. |
| 421 | self.assertEqual(calendar.monthrange(2004,12), (2,31)) |
| 422 | |
| 423 | def test_zeroth_month(self): |
| 424 | # Tests low invalid boundary case. |
| 425 | with self.assertRaises(calendar.IllegalMonthError): |
| 426 | calendar.monthrange(2004, 0) |
| 427 | |
| 428 | def test_thirteenth_month(self): |
| 429 | # Tests high invalid boundary case. |
| 430 | with self.assertRaises(calendar.IllegalMonthError): |
| 431 | calendar.monthrange(2004, 13) |
| 432 | |
R. David Murray | 1daaf9e | 2010-12-31 19:21:14 +0000 | [diff] [blame] | 433 | class LeapdaysTestCase(unittest.TestCase): |
| 434 | def test_no_range(self): |
| 435 | # test when no range i.e. two identical years as args |
| 436 | self.assertEqual(calendar.leapdays(2010,2010), 0) |
| 437 | |
| 438 | def test_no_leapdays(self): |
| 439 | # test when no leap years in range |
| 440 | self.assertEqual(calendar.leapdays(2010,2011), 0) |
| 441 | |
| 442 | def test_no_leapdays_upper_boundary(self): |
| 443 | # test no leap years in range, when upper boundary is a leap year |
| 444 | self.assertEqual(calendar.leapdays(2010,2012), 0) |
| 445 | |
| 446 | def test_one_leapday_lower_boundary(self): |
| 447 | # test when one leap year in range, lower boundary is leap year |
| 448 | self.assertEqual(calendar.leapdays(2012,2013), 1) |
| 449 | |
| 450 | def test_several_leapyears_in_range(self): |
| 451 | self.assertEqual(calendar.leapdays(1997,2020), 5) |
| 452 | |
Brett Cannon | cfae36f | 2010-07-23 13:54:14 +0000 | [diff] [blame] | 453 | |
Fred Drake | d077ca1 | 2001-12-12 05:38:08 +0000 | [diff] [blame] | 454 | def test_main(): |
Benjamin Peterson | ee8712c | 2008-05-20 21:35:26 +0000 | [diff] [blame] | 455 | support.run_unittest( |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 456 | OutputTestCase, |
Walter Dörwald | 59ad456 | 2004-07-02 19:00:09 +0000 | [diff] [blame] | 457 | CalendarTestCase, |
Walter Dörwald | 302fa6d | 2004-07-08 17:14:17 +0000 | [diff] [blame] | 458 | MondayTestCase, |
Alexander Belopolsky | 43ca710 | 2010-06-14 17:32:03 +0000 | [diff] [blame] | 459 | SundayTestCase, |
| 460 | TimegmTestCase, |
Brett Cannon | cfae36f | 2010-07-23 13:54:14 +0000 | [diff] [blame] | 461 | MonthRangeTestCase, |
R. David Murray | 1daaf9e | 2010-12-31 19:21:14 +0000 | [diff] [blame] | 462 | LeapdaysTestCase, |
Walter Dörwald | 59ad456 | 2004-07-02 19:00:09 +0000 | [diff] [blame] | 463 | ) |
| 464 | |
Fred Drake | d077ca1 | 2001-12-12 05:38:08 +0000 | [diff] [blame] | 465 | |
| 466 | if __name__ == "__main__": |
| 467 | test_main() |