<s> from Pyblosxom . plugins import w3cdate <EOL> import os <EOL> import unittest <EOL> import time <EOL> class W3CDateTest ( unittest . TestCase ) : <EOL> entry1 = { "<STR_LIT>" : ( <NUM_LIT> , <NUM_LIT:1> , <NUM_LIT> , <NUM_LIT:15> , <NUM_LIT> , <NUM_LIT:20> , <NUM_LIT:6> , <NUM_LIT> , <NUM_LIT:0> ) } <EOL> entry2 = { "<STR_LIT>" : ( <NUM_LIT> , <NUM_LIT:1> , <NUM_LIT> , <NUM_LIT:15> , <NUM_LIT> , <NUM_LIT> , <NUM_LIT:6> , <NUM_LIT> , <NUM_LIT:0> ) } <EOL> entry3 = { "<STR_LIT>" : ( <NUM_LIT> , <NUM_LIT:1> , <NUM_LIT:11> , <NUM_LIT> , <NUM_LIT:6> , <NUM_LIT> , <NUM_LIT:0> , <NUM_LIT:11> , <NUM_LIT:0> ) } <EOL> def test_get_formatted_date ( self ) : <EOL> gfd = w3cdate . get_formatted_date <EOL> tz = os . environ . get ( '<STR_LIT>' ) <EOL> os . environ [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> time . tzset ( ) <EOL> self . assertEquals ( gfd ( W3CDateTest . entry1 ) , <EOL> "<STR_LIT>" ) <EOL> if tz is None : <EOL> del os . environ [ '<STR_LIT>' ] <EOL> else : <EOL> os . environ [ '<STR_LIT>' ] = tz <EOL> time . tzset ( ) <EOL> def test_head_and_foot ( self ) : <EOL> from Pyblosxom . pyblosxom import Request <EOL> gfd = w3cdate . get_formatted_date <EOL> entry1 = dict ( W3CDateTest . entry1 ) <EOL> entry2 = dict ( W3CDateTest . entry2 ) <EOL> entry3 = dict ( W3CDateTest . entry3 ) <EOL> req = Request ( { } , { } , { "<STR_LIT>" : [ entry1 , entry2 , entry3 ] } ) <EOL> entry = { } <EOL> args = { "<STR_LIT>" : entry , "<STR_LIT>" : req } <EOL> w3cdate . cb_head ( args ) <EOL> self . assertEquals ( entry [ "<STR_LIT>" ] , gfd ( self . entry1 ) ) <EOL> req = Request ( { } , { } , { "<STR_LIT>" : [ entry3 , entry2 , entry1 ] } ) <EOL> entry = { } <EOL> args = { "<STR_LIT>" : entry , "<STR_LIT>" : req } <EOL> w3cdate . cb_head ( args ) <EOL> self . assertEquals ( entry [ "<STR_LIT>" ] , gfd ( self . entry3 ) ) <EOL> def test_story ( self ) : <EOL> entry = dict ( self . entry1 ) <EOL> args = { "<STR_LIT>" : entry } <EOL> w3cdate . cb_story ( args ) <EOL> self . assertEquals ( entry [ '<STR_LIT>' ] , w3cdate . get_formatted_date ( entry ) ) </s>
