@@ -36,15 +36,15 @@ def test_add_correct_result(self):
3636 response = self .client .post (self .path , self .data )
3737
3838 # Check that we get a success response
39- self .assertEquals (response .status_code , 202 )
40- self .assertEquals (response .content .decode (), "Result data saved successfully" )
39+ self .assertEqual (response .status_code , 202 )
40+ self .assertEqual (response .content .decode (), "Result data saved successfully" )
4141
4242 # Check that the data was correctly saved
4343 e = Environment .objects .get (name = 'Dual Core' )
4444 b = Benchmark .objects .get (name = 'float' )
45- self .assertEquals (b .benchmark_type , "C" )
46- self .assertEquals (b .units , "seconds" )
47- self .assertEquals (b .lessisbetter , True )
45+ self .assertEqual (b .benchmark_type , "C" )
46+ self .assertEqual (b .units , "seconds" )
47+ self .assertEqual (b .lessisbetter , True )
4848 p = Project .objects .get (name = 'MyProject' )
4949 branch = Branch .objects .get (name = 'default' , project = p )
5050 r = Revision .objects .get (commitid = '23' , branch = branch )
@@ -68,15 +68,15 @@ def test_add_non_default_result(self):
6868 modified_data ['max' ] = 2
6969 modified_data ['min' ] = 1.0
7070 response = self .client .post (self .path , modified_data )
71- self .assertEquals (response .status_code , 202 )
72- self .assertEquals (response .content .decode (), "Result data saved successfully" )
71+ self .assertEqual (response .status_code , 202 )
72+ self .assertEqual (response .content .decode (), "Result data saved successfully" )
7373 e = Environment .objects .get (name = 'Dual Core' )
7474 p = Project .objects .get (name = 'MyProject' )
7575 branch = Branch .objects .get (name = 'default' , project = p )
7676 r = Revision .objects .get (commitid = '23' , branch = branch )
7777
7878 # Tweak the resolution down to avoid failing over very slight differences:
79- self .assertEquals (r .date , revision_date )
79+ self .assertEqual (r .date , revision_date )
8080
8181 i = Executable .objects .get (name = 'myexe O3 64bits' )
8282 b = Benchmark .objects .get (name = 'float' )
@@ -86,18 +86,18 @@ def test_add_non_default_result(self):
8686 benchmark = b ,
8787 environment = e
8888 )
89- self .assertEquals (res .date , result_date )
90- self .assertEquals (res .std_dev , 1.11111 )
91- self .assertEquals (res .val_max , 2 )
92- self .assertEquals (res .val_min , 1 )
89+ self .assertEqual (res .date , result_date )
90+ self .assertEqual (res .std_dev , 1.11111 )
91+ self .assertEqual (res .val_max , 2 )
92+ self .assertEqual (res .val_min , 1 )
9393
9494 def test_bad_environment (self ):
9595 """Should return 400 when environment does not exist"""
9696 bad_name = '10 Core'
9797 self .data ['environment' ] = bad_name
9898 response = self .client .post (self .path , self .data )
99- self .assertEquals (response .status_code , 400 )
100- self .assertEquals (response .content .decode (),
99+ self .assertEqual (response .status_code , 400 )
100+ self .assertEqual (response .content .decode (),
101101 "Environment " + bad_name + " not found" )
102102 self .data ['environment' ] = 'Dual Core'
103103
@@ -107,8 +107,8 @@ def test_empty_argument(self):
107107 backup = self .data [key ]
108108 self .data [key ] = ""
109109 response = self .client .post (self .path , self .data )
110- self .assertEquals (response .status_code , 400 )
111- self .assertEquals (
110+ self .assertEqual (response .status_code , 400 )
111+ self .assertEqual (
112112 response .content .decode (),
113113 'Value for key "' + key + '" empty in request' )
114114 self .data [key ] = backup
@@ -119,8 +119,8 @@ def test_missing_argument(self):
119119 backup = self .data [key ]
120120 del (self .data [key ])
121121 response = self .client .post (self .path , self .data )
122- self .assertEquals (response .status_code , 400 )
123- self .assertEquals (
122+ self .assertEqual (response .status_code , 400 )
123+ self .assertEqual (
124124 response .content .decode (),
125125 'Key "' + key + '" missing from request' )
126126 self .data [key ] = backup
@@ -130,7 +130,7 @@ def test_report_is_not_created(self):
130130 self .client .post (self .path , self .data )
131131 number_of_reports = len (Report .objects .all ())
132132 # After adding one result for one revision, there should be no reports
133- self .assertEquals (number_of_reports , 0 )
133+ self .assertEqual (number_of_reports , 0 )
134134
135135 def test_report_is_created (self ):
136136 """Should create a report when adding a result for two revisions"""
@@ -142,23 +142,23 @@ def test_report_is_created(self):
142142 # Second result should trigger report creation
143143 self .client .post (self .path , modified_data )
144144 number_of_reports = len (Report .objects .all ())
145- self .assertEquals (number_of_reports , 1 )
145+ self .assertEqual (number_of_reports , 1 )
146146
147147 def test_submit_data_with_none_timestamp (self ):
148148 """Should add a default revision date when timestamp is None"""
149149 modified_data = copy .deepcopy (self .data )
150150 modified_data ['revision_date' ] = 'None'
151151 response = self .client .post (self .path , modified_data )
152- self .assertEquals (response .status_code , 202 )
152+ self .assertEqual (response .status_code , 202 )
153153
154154 def test_add_result_with_no_project (self ):
155155 """Should add a revision with the project"""
156156 modified_data = copy .deepcopy (self .data )
157157 modified_data ['project' ] = "My new project"
158158 modified_data ['executable' ] = "My new executable"
159159 response = self .client .post (self .path , modified_data )
160- self .assertEquals (response .status_code , 202 )
161- self .assertEquals (
160+ self .assertEqual (response .status_code , 202 )
161+ self .assertEqual (
162162 response .content .decode (), "Result data saved successfully" )
163163
164164
@@ -209,24 +209,24 @@ def test_get_returns_405(self):
209209 response = self .client .get (self .path ,
210210 {'json' : json .dumps (self .data )})
211211
212- self .assertEquals (response .status_code , 405 )
212+ self .assertEqual (response .status_code , 405 )
213213
214214 def test_add_correct_results (self ):
215215 """Should add all results when the request data is valid"""
216216 response = self .client .post (self .path ,
217217 {'json' : json .dumps (self .data )})
218218
219219 # Check that we get a success response
220- self .assertEquals (response .status_code , 202 )
221- self .assertEquals (response .content .decode (),
220+ self .assertEqual (response .status_code , 202 )
221+ self .assertEqual (response .content .decode (),
222222 "All result data saved successfully" )
223223
224224 # Check that the data was correctly saved
225225 e = Environment .objects .get (name = 'bigdog' )
226226 b = Benchmark .objects .get (name = 'Richards' )
227- self .assertEquals (b .benchmark_type , "C" )
228- self .assertEquals (b .units , "seconds" )
229- self .assertEquals (b .lessisbetter , True )
227+ self .assertEqual (b .benchmark_type , "C" )
228+ self .assertEqual (b .units , "seconds" )
229+ self .assertEqual (b .lessisbetter , True )
230230 p = Project .objects .get (name = 'pypy' )
231231 branch = Branch .objects .get (name = 'default' , project = p )
232232 r = Revision .objects .get (commitid = '123' , branch = branch )
@@ -270,8 +270,8 @@ def test_bad_environment(self):
270270 response = self .client .post (self .path ,
271271 {'json' : json .dumps (self .data )})
272272
273- self .assertEquals (response .status_code , 400 )
274- self .assertEquals (
273+ self .assertEqual (response .status_code , 400 )
274+ self .assertEqual (
275275 response .content .decode (), "Environment " + bad_name + " not found" )
276276 data ['environment' ] = 'bigdog'
277277
@@ -283,8 +283,8 @@ def test_empty_argument(self):
283283 data [key ] = ""
284284 response = self .client .post (self .path ,
285285 {'json' : json .dumps (self .data )})
286- self .assertEquals (response .status_code , 400 )
287- self .assertEquals (
286+ self .assertEqual (response .status_code , 400 )
287+ self .assertEqual (
288288 response .content .decode (),
289289 'Value for key "' + key + '" empty in request' )
290290 data [key ] = backup
@@ -297,8 +297,8 @@ def test_missing_argument(self):
297297 del (data [key ])
298298 response = self .client .post (self .path ,
299299 {'json' : json .dumps (self .data )})
300- self .assertEquals (response .status_code , 400 )
301- self .assertEquals (
300+ self .assertEqual (response .status_code , 400 )
301+ self .assertEqual (
302302 response .content .decode (), 'Key "' + key + '" missing from request' )
303303 data [key ] = backup
304304
@@ -309,13 +309,13 @@ def test_report_is_created(self):
309309 {'json' : json .dumps (self .data )})
310310
311311 # Check that we get a success response
312- self .assertEquals (response .status_code , 202 )
312+ self .assertEqual (response .status_code , 202 )
313313
314314 number_of_reports = len (Report .objects .all ())
315315 # After adding 4 result for 3 revisions, only 2 reports should be created
316316 # The third revision will need an extra result for Richards2 in order
317317 # to trigger report creation
318- self .assertEquals (number_of_reports , 1 )
318+ self .assertEqual (number_of_reports , 1 )
319319
320320
321321class TestTimeline (TestCase ):
@@ -325,17 +325,17 @@ def test_fixture(self):
325325 """Test the loaded fixture data
326326 """
327327 env = Environment .objects .filter (name = "Dual Core" )
328- self .assertEquals (len (env ), 1 )
328+ self .assertEqual (len (env ), 1 )
329329 benchmarks = Benchmark .objects .filter (name = "float" )
330- self .assertEquals (len (benchmarks ), 1 )
331- self .assertEquals (benchmarks [0 ].units , "seconds" )
330+ self .assertEqual (len (benchmarks ), 1 )
331+ self .assertEqual (benchmarks [0 ].units , "seconds" )
332332 results = benchmarks [0 ].results .all ()
333- self .assertEquals (len (results ), 8 )
333+ self .assertEqual (len (results ), 8 )
334334
335335 def test_timeline (self ):
336336 path = reverse ('timeline' )
337337 response = self .client .get (path )
338- self .assertEquals (response .status_code , 200 )
338+ self .assertEqual (response .status_code , 200 )
339339 responsedata = response .content .decode ()
340340 self .assertIn ("MyProject's Speed Center: Timeline" , responsedata )
341341
@@ -351,26 +351,26 @@ def test_gettimelinedata(self):
351351 "revs" : "2"
352352 }
353353 response = self .client .get (path , data )
354- self .assertEquals (response .status_code , 200 )
354+ self .assertEqual (response .status_code , 200 )
355355 responsedata = json .loads (response .getvalue ().decode ())
356356
357- self .assertEquals (
357+ self .assertEqual (
358358 responsedata ['error' ], "None" , "there should be no errors" )
359- self .assertEquals (
359+ self .assertEqual (
360360 len (responsedata ['timelines' ]), 1 , "there should be 1 benchmark" )
361- self .assertEquals (
361+ self .assertEqual (
362362 len (responsedata ['timelines' ][0 ]['branches' ]),
363363 2 ,
364364 "there should be 2 branches" )
365- self .assertEquals (
365+ self .assertEqual (
366366 len (responsedata ['timelines' ][0 ]['branches' ]['default' ]),
367367 1 ,
368368 "there should be 1 timeline for master" )
369- self .assertEquals (
369+ self .assertEqual (
370370 len (responsedata ['timelines' ][0 ]['branches' ]['master' ]['1' ]),
371371 2 ,
372372 "There are 2 datapoints" )
373- self .assertEquals (
373+ self .assertEqual (
374374 responsedata ['timelines' ][0 ]['branches' ]['master' ]['1' ][1 ],
375375 [u'2011/04/13 17:04:22 ' , 2000.0 , 1.11111 , u'2' , u'' , u'master' ])
376376
0 commit comments