def test_now():
 now = datetime.datetime.utcnow()
 t = Time.now()
 assert (t.format == 'datetime')
 assert (t.scale == 'utc')
 dt = (t.datetime - now)
 if (sys.version_info[:2] < (2, 7)):
  total_secs = (lambda td: ((td.microseconds + ((td.seconds + ((td.days * 24) * 3600)) * (10 ** 6))) / (10 ** 6.0)))
 else:
  total_secs = (lambda td: td.total_seconds())
 assert (total_secs(dt) < 0.1)

def test_now ( ) : now = datetime . datetime . utcnow ( ) t = Time . now ( ) assert ( t . format == 'datetime' ) assert ( t . scale == 'utc' ) dt = ( t . datetime - now ) if ( sys . version_info [ : 2 ] < ( 2 , 7 ) ) : total_secs = ( lambda td : ( ( td . microseconds + ( ( td . seconds + ( ( td . days * 24 ) * 3600 ) ) * ( 10 ** 6 ) ) ) / ( 10 ** 6.0 ) ) ) else : total_secs = ( lambda td : td . total_seconds ( ) ) assert ( total_secs ( dt ) < 0.1 )
tests creating a time object with the now class method .