コード例 #1
0
class utc_true_dst_on( unittest.TestCase ):
    """Tests that specifying the init as UTC works."""
    def setUp( self ):
        self.ts = Timestamp( utcF1 , True )
        
    def testGetUTCTicks( self ):
        assertEquals( 'UTC Ticks' ,
                      self.ts.getUTCTicks(),
                      utc1 )
                      
    def testGetLocalTicks( self ):
        assertEquals( 'Local Ticks' ,
                      self.ts.getLocalTicks() ,
                      ticks1 )
                          
    def testGetUTCString( self ):
        assertEquals( 'Date' ,
                      self.ts.getUTCString() ,
                      utcF1 )
                      
    def testGetLocalString( self ):
        assertEquals( 'Date' ,
                      self.ts.getLocalString() ,
                      format1 )
                      
    def testAltSeparator( self ):
        assertEquals( 'Date' ,
                      self.ts.getUTCString( '/' ) ,
                      utcF1alt )
                      
    def testGetUTCDay( self ):
        assertEquals( 'Day of Month' ,
                      self.ts.getUTCDay() ,
                      utcDay1 )
                      
    def testGetLocalDay( self ):
        assertEquals( 'Day of Month' ,
                      self.ts.getLocalDay() ,
                      day1 )
                      
    def testGetCVSTime( self ):
        assertEquals( 'CVS Time',
                      self.ts.getLocalCVSTime() ,
                      cvstime1 )
コード例 #2
0
class utc_false_dst_off( unittest.TestCase ):
    """Tests that specifying the init as UTC works."""
    def setUp( self ):
        self.ts = Timestamp( format2 , False )
        
    def testGetUTCTicks( self ):
        assertEquals( 'UTC Ticks' ,
                      self.ts.getUTCTicks(),
                      utc2 )
                      
    def testGetLocalTicks( self ):
        assertEquals( 'Local Ticks' ,
                      self.ts.getLocalTicks() ,
                      ticks2 )
                          
    def testGetUTCString( self ):
        assertEquals( 'Date' ,
                      self.ts.getUTCString() ,
                      utcF2 )
                      
    def testGetLocalString( self ):
        assertEquals( 'Date' ,
                      self.ts.getLocalString() ,
                      format2 )
                      
    def testAltSeparator( self ):
        assertEquals( 'Date' ,
                      self.ts.getLocalString('/') ,
                      format2alt )
                      
    def testGetLocalDay( self ):
        assertEquals( 'Day of Month' ,
                      self.ts.getLocalDay() ,
                      day2 )
                      
    def testGetUTCDay( self ):
        assertEquals( 'Day of Month' ,
                      self.ts.getUTCDay() ,
                      utcDay2 )