#NEWLINE# @ with_database #NEWLINE# def test_insert_fingerprint( conn ) : #NEWLINE# #INDENT# id = insert_fingerprint ( conn , { #NEWLINE# #INDENT# 'fingerprint' : [ 1 , 2 , 3 , 4 , 5 , 6 ] , #NEWLINE# 'length' : 123 , #NEWLINE# 'bitrate' : 192 , #NEWLINE# 'source_id' : 1 , #NEWLINE# 'format_id' : 1 , #NEWLINE# 'track_id' : 2 , #NEWLINE# #UNINDENT# } ) #NEWLINE# assert_equals ( 1 , id ) #NEWLINE# rows = conn . execute ( '\n        SELECT fingerprint, length, bitrate, format_id, track_id\n        FROM fingerprint WHERE id=%s\n    ' , ( id , ) ) . fetchall ( ) #NEWLINE# expected_rows = [ ( [ 1 , 2 , 3 , 4 , 5 , 6 ] , 123 , 192 , 1 , 2 ) ] #NEWLINE# assert_equals ( expected_rows , conn )