#NEWLINE# def test_make_signature( self ) : #NEWLINE# #INDENT# from gitmodel import utils #NEWLINE# from datetime import datetime #NEWLINE# from time import time #NEWLINE# from dateutil.tz import tzlocal #NEWLINE# timestamp = time ( ) #NEWLINE# dt = datetime . fromtimestamp ( timestamp ) #NEWLINE# aware = datetime ( dt . year , dt . month , dt . day , dt . hour , dt . minute , dt . second , dt . microsecond , tzinfo = tzlocal ( ) ) #NEWLINE# seconds = ( aware . utcoffset ( ) . days * 86400 ) #NEWLINE# seconds += aware . utcoffset ( ) . seconds #NEWLINE# offset = ( seconds / 60 ) #NEWLINE# test_sig = utils . make_signature ( 'Tester Test' , 'test@example.com' , timestamp = timestamp ) #NEWLINE# self . assertEqual ( test_sig . name , 'Tester Test' ) #NEWLINE# self . assertEqual ( test_sig . email , 'test@example.com' ) #NEWLINE# self . assertEqual ( test_sig . offset , offset ) #NEWLINE# self . assertAlmostEqual ( test_sig . time , timestamp , ( - 1 ) ) #NEWLINE# test_sig = utils . make_signature ( 'Tester Test' , 'test@example.com' ) #NEWLINE# self . assertAlmostEqual ( test_sig . time , timestamp , delta = 10 )