1818 Copyright: Copyright (c) 2013-2014 Snowplow Analytics Ltd
1919 License: Apache License Version 2.0
2020'''
21- import requests
21+
2222import unittest
2323import time
2424import re
2525from snowplow_tracker import tracker
2626from httmock import all_requests , HTTMock
2727
28- '''
29- @all_requests
30- def pass_response_content(url, request):
31- return 'True'
32- '''
33-
3428def from_querystring (field , url ):
3529 pattern = re .compile ('^[^#]*[?&]' + field + '=([^&#]*)' )
3630 match = pattern .match (url )
@@ -86,7 +80,6 @@ def test_integration_struct_event(self):
8680 with HTTMock (pass_response_content ):
8781 val = t .track_struct_event ('Ecomm' , 'add-to-basket' , 'dog-skateboarding-video' , 'hd' , 13.99 )
8882 assertion_array = {'se_ca' : 'Ecomm' , 'se_pr' : 'hd' , 'se_la' : 'dog-skateboarding-video' , 'se_va' : '13.99' , 'se_ac' : 'add-to-basket' , 'e' : 'se' }
89- self .assertTrue (val )
9083 for key in assertion_array :
9184 self .assertEquals (from_querystring (key , val ), assertion_array [key ])
9285
@@ -96,7 +89,6 @@ def test_integration_unstruct_event_non_base64(self):
9689 t .config ['encode_base64' ] = False
9790 with HTTMock (pass_response_content ):
9891 val = t .track_unstruct_event ('viewed_product' , {'product_id' : 'ASO01043' , 'price$flt' : 49.95 , 'walrus$tms' : int (time .time () * 1000 ),})
99- self .assertTrue (val )
10092 assertion_array = {'e' : 'ue' , 'ue_na' : 'viewed_product' }
10193 for key in assertion_array :
10294 self .assertEquals (from_querystring (key , val ), assertion_array [key ])
0 commit comments