@@ -84,15 +84,15 @@ def test_integration_page_view(self):
8484 t .track_page_view ("http://savethearctic.org" , "Save The Arctic" , "http://referrer.com" )
8585 expected_fields = {"e" : "pv" , "page" : "Save+The+Arctic" , "url" : "http%3A%2F%2Fsavethearctic.org" , "refr" : "http%3A%2F%2Freferrer.com" }
8686 for key in expected_fields :
87- self .assertEquals (from_querystring (key , querystrings [- 1 ]), expected_fields [key ])
87+ self .assertEqual (from_querystring (key , querystrings [- 1 ]), expected_fields [key ])
8888
8989 def test_integration_ecommerce_transaction_item (self ):
9090 t = tracker .Tracker ([default_emitter ], default_subject )
9191 with HTTMock (pass_response_content ):
9292 t .track_ecommerce_transaction_item ("12345" , "pbz0025" , 7.99 , 2 , "black-tarot" , "tarot" , currency = "GBP" )
9393 expected_fields = {"ti_ca" : "tarot" , "ti_id" : "12345" , "ti_qu" : "2" , "ti_sk" : "pbz0025" , "e" : "ti" , "ti_nm" : "black-tarot" , "ti_pr" : "7.99" , "ti_cu" : "GBP" }
9494 for key in expected_fields :
95- self .assertEquals (from_querystring (key , querystrings [- 1 ]), expected_fields [key ])
95+ self .assertEqual (from_querystring (key , querystrings [- 1 ]), expected_fields [key ])
9696
9797 def test_integration_ecommerce_transaction (self ):
9898 t = tracker .Tracker ([default_emitter ], default_subject )
@@ -111,28 +111,28 @@ def test_integration_ecommerce_transaction(self):
111111
112112 expected_fields = {"e" : "tr" , "tr_id" : "6a8078be" , "tr_tt" : "35" , "tr_ci" : "London" , "tr_cu" : "GBP" }
113113 for key in expected_fields :
114- self .assertEquals (from_querystring (key , querystrings [- 3 ]), expected_fields [key ])
114+ self .assertEqual (from_querystring (key , querystrings [- 3 ]), expected_fields [key ])
115115
116116 expected_fields = {"e" : "ti" , "ti_id" : "6a8078be" , "ti_sk" : "pbz0026" , "ti_pr" : "20" , "ti_cu" : "GBP" }
117117 for key in expected_fields :
118- self .assertEquals (from_querystring (key , querystrings [- 2 ]), expected_fields [key ])
118+ self .assertEqual (from_querystring (key , querystrings [- 2 ]), expected_fields [key ])
119119
120120 expected_fields = {"e" : "ti" , "ti_id" : "6a8078be" , "ti_sk" : "pbz0038" , "ti_pr" : "15" , "ti_cu" : "GBP" }
121121 for key in expected_fields :
122- self .assertEquals (from_querystring (key , querystrings [- 1 ]), expected_fields [key ])
122+ self .assertEqual (from_querystring (key , querystrings [- 1 ]), expected_fields [key ])
123123
124- self .assertEquals (from_querystring ("dtm" , querystrings [- 3 ]), from_querystring ("dtm" , querystrings [- 2 ]))
124+ self .assertEqual (from_querystring ("dtm" , querystrings [- 3 ]), from_querystring ("dtm" , querystrings [- 2 ]))
125125
126126 def test_integration_screen_view (self ):
127127 t = tracker .Tracker ([default_emitter ], default_subject , encode_base64 = False )
128128 with HTTMock (pass_response_content ):
129129 t .track_screen_view ("Game HUD 2" , id_ = "534" )
130130 expected_fields = {"e" : "ue" }
131131 for key in expected_fields :
132- self .assertEquals (from_querystring (key , querystrings [- 1 ]), expected_fields [key ])
132+ self .assertEqual (from_querystring (key , querystrings [- 1 ]), expected_fields [key ])
133133 envelope_string = from_querystring ("ue_pr" , querystrings [- 1 ])
134134 envelope = json .loads (unquote_plus (envelope_string ))
135- self .assertEquals (envelope , {
135+ self .assertEqual (envelope , {
136136 "schema" : "iglu:com.snowplowanalytics.snowplow/unstruct_event/jsonschema/1-0-0" ,
137137 "data" : {"schema" : "iglu:com.snowplowanalytics.snowplow/screen_view/jsonschema/1-0-0" ,
138138 "data" : {
@@ -148,18 +148,18 @@ def test_integration_struct_event(self):
148148 t .track_struct_event ("Ecomm" , "add-to-basket" , "dog-skateboarding-video" , "hd" , 13.99 )
149149 expected_fields = {"se_ca" : "Ecomm" , "se_pr" : "hd" , "se_la" : "dog-skateboarding-video" , "se_va" : "13.99" , "se_ac" : "add-to-basket" , "e" : "se" }
150150 for key in expected_fields :
151- self .assertEquals (from_querystring (key , querystrings [- 1 ]), expected_fields [key ])
151+ self .assertEqual (from_querystring (key , querystrings [- 1 ]), expected_fields [key ])
152152
153153 def test_integration_unstruct_event_non_base64 (self ):
154154 t = tracker .Tracker ([default_emitter ], default_subject , encode_base64 = False )
155155 with HTTMock (pass_response_content ):
156156 t .track_unstruct_event (SelfDescribingJson ("iglu:com.acme/viewed_product/jsonschema/2-0-2" , {"product_id" : "ASO01043" , "price$flt" : 49.95 , "walrus$tms" : 1000 }))
157157 expected_fields = {"e" : "ue" }
158158 for key in expected_fields :
159- self .assertEquals (from_querystring (key , querystrings [- 1 ]), expected_fields [key ])
159+ self .assertEqual (from_querystring (key , querystrings [- 1 ]), expected_fields [key ])
160160 envelope_string = from_querystring ("ue_pr" , querystrings [- 1 ])
161161 envelope = json .loads (unquote_plus (envelope_string ))
162- self .assertEquals (envelope , {
162+ self .assertEqual (envelope , {
163163 "schema" : "iglu:com.snowplowanalytics.snowplow/unstruct_event/jsonschema/1-0-0" ,
164164 "data" : {"schema" : "iglu:com.acme/viewed_product/jsonschema/2-0-2" , "data" : {"product_id" : "ASO01043" , "price$flt" : 49.95 , "walrus$tms" : 1000 }}
165165 })
@@ -170,10 +170,10 @@ def test_integration_unstruct_event_base64(self):
170170 t .track_unstruct_event (SelfDescribingJson ("iglu:com.acme/viewed_product/jsonschema/2-0-2" , {"product_id" : "ASO01043" , "price$flt" : 49.95 , "walrus$tms" : 1000 }))
171171 expected_fields = {"e" : "ue" }
172172 for key in expected_fields :
173- self .assertEquals (from_querystring (key , querystrings [- 1 ]), expected_fields [key ])
173+ self .assertEqual (from_querystring (key , querystrings [- 1 ]), expected_fields [key ])
174174 envelope_string = unquote_plus (from_querystring ("ue_px" , querystrings [- 1 ]))
175175 envelope = json .loads ((base64 .urlsafe_b64decode (bytearray (envelope_string , "utf-8" ))).decode ("utf-8" ))
176- self .assertEquals (envelope , {
176+ self .assertEqual (envelope , {
177177 "schema" : "iglu:com.snowplowanalytics.snowplow/unstruct_event/jsonschema/1-0-0" ,
178178 "data" : {"schema" : "iglu:com.acme/viewed_product/jsonschema/2-0-2" , "data" : {"product_id" : "ASO01043" , "price$flt" : 49.95 , "walrus$tms" : 1000 }}
179179 })
@@ -184,7 +184,7 @@ def test_integration_context_non_base64(self):
184184 t .track_page_view ("localhost" , "local host" , None , [SelfDescribingJson ("iglu:com.example/user/jsonschema/2-0-3" , {"user_type" : "tester" })])
185185 envelope_string = from_querystring ("co" , querystrings [- 1 ])
186186 envelope = json .loads (unquote_plus (envelope_string ))
187- self .assertEquals (envelope , {
187+ self .assertEqual (envelope , {
188188 "schema" : "iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-1" ,
189189 "data" :[{"schema" : "iglu:com.example/user/jsonschema/2-0-3" , "data" : {"user_type" : "tester" }}]
190190 })
@@ -195,7 +195,7 @@ def test_integration_context_base64(self):
195195 t .track_page_view ("localhost" , "local host" , None , [SelfDescribingJson ("iglu:com.example/user/jsonschema/2-0-3" , {"user_type" : "tester" })])
196196 envelope_string = unquote_plus (from_querystring ("cx" , querystrings [- 1 ]))
197197 envelope = json .loads ((base64 .urlsafe_b64decode (bytearray (envelope_string , "utf-8" ))).decode ("utf-8" ))
198- self .assertEquals (envelope , {
198+ self .assertEqual (envelope , {
199199 "schema" : "iglu:com.snowplowanalytics.snowplow/contexts/jsonschema/1-0-1" ,
200200 "data" :[{"schema" : "iglu:com.example/user/jsonschema/2-0-3" , "data" : {"user_type" : "tester" }}]
201201 })
@@ -216,7 +216,7 @@ def test_integration_standard_nv_pairs(self):
216216 "lang" : "en" , "aid" : "angry-birds-android" , "cd" : "24" , "tz" : "Europe+London" ,
217217 "p" : "mob" , "tv" : "py-" + _version .__version__ }
218218 for key in expected_fields :
219- self .assertEquals (from_querystring (key , querystrings [- 1 ]), expected_fields [key ])
219+ self .assertEqual (from_querystring (key , querystrings [- 1 ]), expected_fields [key ])
220220 self .assertIsNotNone (from_querystring ("eid" , querystrings [- 1 ]))
221221 self .assertIsNotNone (from_querystring ("dtm" , querystrings [- 1 ]))
222222
@@ -237,7 +237,7 @@ def test_integration_identification_methods(self):
237237 "tnuid" : "fbc6c76c-bce5-43ce-8d5a-31c5"
238238 }
239239 for key in expected_fields :
240- self .assertEquals (from_querystring (key , querystrings [- 1 ]), expected_fields [key ])
240+ self .assertEqual (from_querystring (key , querystrings [- 1 ]), expected_fields [key ])
241241
242242 def test_integration_redis_default (self ):
243243 try :
@@ -247,7 +247,7 @@ def test_integration_redis_default(self):
247247 t .track_page_view ("http://www.example.com" )
248248 event_string = r .rpop ("snowplow" )
249249 event_dict = json .loads (event_string .decode ("utf-8" ))
250- self .assertEquals (event_dict ["e" ], "pv" )
250+ self .assertEqual (event_dict ["e" ], "pv" )
251251 except ImportError :
252252 with pytest .raises (RuntimeError ):
253253 re = redis_emitter .RedisEmitter ()
@@ -260,7 +260,7 @@ def test_integration_redis_custom(self):
260260 t .track_page_view ("http://www.example.com" )
261261 event_string = r .rpop ("custom_key" )
262262 event_dict = json .loads (event_string .decode ("utf-8" ))
263- self .assertEquals (event_dict ["e" ], "pv" )
263+ self .assertEqual (event_dict ["e" ], "pv" )
264264 except ImportError :
265265 with pytest .raises (RuntimeError ):
266266 re = redis_emitter .RedisEmitter ("arg" , key = "kwarg" )
@@ -273,8 +273,8 @@ def test_integration_success_callback(self):
273273 t = tracker .Tracker ([callback_emitter ], default_subject )
274274 with HTTMock (pass_response_content ):
275275 t .track_page_view ("http://www.example.com" )
276- self .assertEquals (callback_success_queue [0 ], 1 )
277- self .assertEquals (callback_failure_queue , [])
276+ self .assertEqual (callback_success_queue [0 ], 1 )
277+ self .assertEqual (callback_failure_queue , [])
278278
279279 def test_integration_failure_callback (self ):
280280 callback_success_queue = []
@@ -284,27 +284,27 @@ def test_integration_failure_callback(self):
284284 t = tracker .Tracker ([callback_emitter ], default_subject )
285285 with HTTMock (fail_response_content ):
286286 t .track_page_view ("http://www.example.com" )
287- self .assertEquals (callback_success_queue , [])
288- self .assertEquals (callback_failure_queue [0 ], 0 )
287+ self .assertEqual (callback_success_queue , [])
288+ self .assertEqual (callback_failure_queue [0 ], 0 )
289289
290290 def test_post_page_view (self ):
291291 t = tracker .Tracker ([post_emitter ], default_subject )
292292 with HTTMock (pass_post_response_content ):
293293 t .track_page_view ("localhost" , "local host" , None )
294294 expected_fields = {"e" : "pv" , "page" : "local host" , "url" : "localhost" }
295295 request = querystrings [- 1 ]
296- self .assertEquals (request ["schema" ], "iglu:com.snowplowanalytics.snowplow/payload_data/jsonschema/1-0-4" )
296+ self .assertEqual (request ["schema" ], "iglu:com.snowplowanalytics.snowplow/payload_data/jsonschema/1-0-4" )
297297 for key in expected_fields :
298- self .assertEquals (request ["data" ][0 ][key ], expected_fields [key ])
298+ self .assertEqual (request ["data" ][0 ][key ], expected_fields [key ])
299299
300300 def test_post_batched (self ):
301301 post_emitter = emitters .Emitter ("localhost" , protocol = "http" , port = 80 , method = 'post' , buffer_size = 2 )
302302 t = tracker .Tracker (post_emitter , default_subject )
303303 with HTTMock (pass_post_response_content ):
304304 t .track_struct_event ("Test" , "A" )
305305 t .track_struct_event ("Test" , "B" )
306- self .assertEquals (querystrings [- 1 ]["data" ][0 ]["se_ac" ], "A" )
307- self .assertEquals (querystrings [- 1 ]["data" ][1 ]["se_ac" ], "B" )
306+ self .assertEqual (querystrings [- 1 ]["data" ][0 ]["se_ac" ], "A" )
307+ self .assertEqual (querystrings [- 1 ]["data" ][1 ]["se_ac" ], "B" )
308308
309309 def test_timestamps (self ):
310310 emitter = emitters .Emitter ("localhost" , protocol = "http" , port = 80 , method = 'post' , buffer_size = 4 )
@@ -326,10 +326,10 @@ def test_timestamps(self):
326326 request = querystrings [- 1 ]
327327
328328 for i , event in enumerate (expected_timestamps ):
329- self .assertEquals (request ["data" ][i ].get ("dtm" ), expected_timestamps [i ]["dtm" ])
330- self .assertEquals (request ["data" ][i ].get ("ttm" ), expected_timestamps [i ]["ttm" ])
331- self .assertEquals (request ["data" ][i ].get ("stm" ), expected_timestamps [i ]["stm" ])
332- self .assertEquals (request ["data" ][i ].get ("page" ), "stamp" + str (i ))
329+ self .assertEqual (request ["data" ][i ].get ("dtm" ), expected_timestamps [i ]["dtm" ])
330+ self .assertEqual (request ["data" ][i ].get ("ttm" ), expected_timestamps [i ]["ttm" ])
331+ self .assertEqual (request ["data" ][i ].get ("stm" ), expected_timestamps [i ]["stm" ])
332+ self .assertEqual (request ["data" ][i ].get ("page" ), "stamp" + str (i ))
333333
334334 def test_bytelimit (self ):
335335 post_emitter = emitters .Emitter ("localhost" , protocol = "http" , port = 80 , method = 'post' , buffer_size = 5 , byte_limit = 420 )
@@ -339,5 +339,5 @@ def test_bytelimit(self):
339339 t .track_struct_event ("Test" , "A" ) # 280 bytes
340340 t .track_struct_event ("Test" , "A" ) # 420 bytes. Send
341341 t .track_struct_event ("Test" , "AA" ) # 141
342- self .assertEquals (len (querystrings [- 1 ]["data" ]), 3 )
342+ self .assertEqual (len (querystrings [- 1 ]["data" ]), 3 )
343343 self .assertEqual (post_emitter .bytes_queued , 136 + len (_version .__version__ ))
0 commit comments