1313from robot .model import SuiteVisitor
1414from robot .running import namespace
1515from robot .utils import StringIO
16- from robot .utils .asserts import assert_equals , assert_true
16+ from robot .utils .asserts import assert_equal , assert_true
1717
1818from resources .runningtestcase import RunningTestCase
1919from resources .Listener import Listener
@@ -54,78 +54,78 @@ class TestRun(RunningTestCase):
5454 remove_files = [LOG_PATH , REPORT_PATH , OUTPUT_PATH ]
5555
5656 def test_run_once (self ):
57- assert_equals (run (self .data , outputdir = TEMP , report = 'none' ), 1 )
57+ assert_equal (run (self .data , outputdir = TEMP , report = 'none' ), 1 )
5858 self ._assert_outputs ([('Pass And Fail' , 2 ), (LOG , 1 ), ('Report:' , 0 )])
5959 assert exists (LOG_PATH )
6060
6161 def test_run_multiple_times (self ):
62- assert_equals (run_without_outputs (self .data , critical = 'nomatch' ), 0 )
63- assert_equals (run_without_outputs (self .data , name = 'New Name' ), 1 )
62+ assert_equal (run_without_outputs (self .data , critical = 'nomatch' ), 0 )
63+ assert_equal (run_without_outputs (self .data , name = 'New Name' ), 1 )
6464 self ._assert_outputs ([('Pass And Fail' , 2 ), ('New Name' , 2 ), (LOG , 0 )])
6565
6666 def test_run_fail (self ):
67- assert_equals (run (self .data , outputdir = TEMP ), 1 )
67+ assert_equal (run (self .data , outputdir = TEMP ), 1 )
6868 self ._assert_outputs (stdout = [('Pass And Fail' , 2 ), (LOG , 1 )])
6969
7070 def test_run_error (self ):
71- assert_equals (run (self .nonex ), 252 )
71+ assert_equal (run (self .nonex ), 252 )
7272 self ._assert_outputs (stderr = [('[ ERROR ]' , 1 ), (self .nonex , 1 ),
7373 ('--help' , 1 )])
7474
7575 def test_custom_stdout (self ):
7676 stdout = StringIO ()
77- assert_equals (run_without_outputs (self .data , stdout = stdout ), 1 )
77+ assert_equal (run_without_outputs (self .data , stdout = stdout ), 1 )
7878 self ._assert_output (stdout , [('Pass And Fail' , 2 ), ('Output:' , 1 ),
7979 ('Log:' , 0 ), ('Report:' , 0 )])
8080 self ._assert_outputs ()
8181
8282 def test_custom_stderr (self ):
8383 stderr = StringIO ()
84- assert_equals (run_without_outputs (self .warn , stderr = stderr ), 0 )
84+ assert_equal (run_without_outputs (self .warn , stderr = stderr ), 0 )
8585 self ._assert_output (stderr , [('[ WARN ]' , 4 ), ('[ ERROR ]' , 2 )])
8686 self ._assert_outputs ([('Warnings And Errors' , 2 ), ('Output:' , 1 ),
8787 ('Log:' , 0 ), ('Report:' , 0 )])
8888
8989 def test_custom_stdout_and_stderr_with_minimal_implementation (self ):
9090 output = StreamWithOnlyWriteAndFlush ()
91- assert_equals (run_without_outputs (self .warn , stdout = output , stderr = output ), 0 )
91+ assert_equal (run_without_outputs (self .warn , stdout = output , stderr = output ), 0 )
9292 self ._assert_output (output , [('[ WARN ]' , 4 ), ('[ ERROR ]' , 2 ),
9393 ('Warnings And Errors' , 3 ), ('Output:' , 1 ),
9494 ('Log:' , 0 ), ('Report:' , 0 )])
9595 self ._assert_outputs ()
9696
9797 def test_multi_options_as_single_string (self ):
98- assert_equals (run_without_outputs (self .data , exclude = 'fail' ), 0 )
98+ assert_equal (run_without_outputs (self .data , exclude = 'fail' ), 0 )
9999 self ._assert_outputs ([('FAIL' , 0 )])
100100
101101 def test_listener_gets_notification_about_log_report_and_output (self ):
102102 listener = join (ROOT , 'utest' , 'resources' , 'Listener.py' )
103- assert_equals (run (self .data , output = OUTPUT_PATH , report = REPORT_PATH ,
103+ assert_equal (run (self .data , output = OUTPUT_PATH , report = REPORT_PATH ,
104104 log = LOG_PATH , listener = listener ), 1 )
105105 self ._assert_outputs (stdout = [('[output {0}]' .format (OUTPUT_PATH ), 1 ),
106106 ('[report {0}]' .format (REPORT_PATH ), 1 ),
107107 ('[log {0}]' .format (LOG_PATH ), 1 ),
108108 ('[listener close]' , 1 )])
109109
110110 def test_pass_listener_as_instance (self ):
111- assert_equals (run_without_outputs (self .data , listener = Listener (1 )), 1 )
111+ assert_equal (run_without_outputs (self .data , listener = Listener (1 )), 1 )
112112 self ._assert_outputs ([("[from listener 1]" , 1 )])
113113
114114 def test_pass_listener_as_string (self ):
115115 module_file = join (ROOT , 'utest' , 'resources' , 'Listener.py' )
116- assert_equals (run_without_outputs (self .data , listener = module_file + ":1" ), 1 )
116+ assert_equal (run_without_outputs (self .data , listener = module_file + ":1" ), 1 )
117117 self ._assert_outputs ([("[from listener 1]" , 1 )])
118118
119119 def test_pass_listener_as_list (self ):
120120 module_file = join (ROOT , 'utest' , 'resources' , 'Listener.py' )
121- assert_equals (run_without_outputs (self .data , listener = [module_file + ":1" , Listener (2 )]), 1 )
121+ assert_equal (run_without_outputs (self .data , listener = [module_file + ":1" , Listener (2 )]), 1 )
122122 self ._assert_outputs ([("[from listener 1]" , 1 ), ("[from listener 2]" , 1 )])
123123
124124 def test_pre_run_modifier_as_instance (self ):
125125 class Modifier (SuiteVisitor ):
126126 def start_suite (self , suite ):
127127 suite .tests = [t for t in suite .tests if t .tags .match ('pass' )]
128- assert_equals (run_without_outputs (self .data , prerunmodifier = Modifier ()), 0 )
128+ assert_equal (run_without_outputs (self .data , prerunmodifier = Modifier ()), 0 )
129129 self ._assert_outputs ([('Pass ' , 1 ), ('Fail :: FAIL' , 0 )])
130130
131131 def test_pre_rebot_modifier_as_instance (self ):
@@ -135,12 +135,12 @@ def __init__(self):
135135 def visit_test (self , test ):
136136 self .tests .append (test .name )
137137 modifier = Modifier ()
138- assert_equals (run (self .data , outputdir = TEMP , log = LOG_PATH , prerebotmodifier = modifier ), 1 )
139- assert_equals (modifier .tests , ['Pass' , 'Fail' ])
138+ assert_equal (run (self .data , outputdir = TEMP , log = LOG_PATH , prerebotmodifier = modifier ), 1 )
139+ assert_equal (modifier .tests , ['Pass' , 'Fail' ])
140140 self ._assert_outputs ([('Pass ' , 1 ), ('Fail :: FAIL' , 1 )])
141141
142142 def test_invalid_modifier (self ):
143- assert_equals (run_without_outputs (self .data , prerunmodifier = 42 ), 1 )
143+ assert_equal (run_without_outputs (self .data , prerunmodifier = 42 ), 1 )
144144 self ._assert_outputs ([('Pass ' , 1 ), ('Fail :: FAIL' , 1 )],
145145 [("[ ERROR ] Executing model modifier 'integer' "
146146 "failed: AttributeError: " , 1 )])
@@ -153,34 +153,34 @@ class TestRebot(RunningTestCase):
153153 remove_files = [LOG_PATH , REPORT_PATH ]
154154
155155 def test_run_once (self ):
156- assert_equals (rebot (self .data , outputdir = TEMP , report = 'NONE' ), 1 )
156+ assert_equal (rebot (self .data , outputdir = TEMP , report = 'NONE' ), 1 )
157157 self ._assert_outputs ([(LOG , 1 ), ('Report:' , 0 )])
158158 assert exists (LOG_PATH )
159159
160160 def test_run_multiple_times (self ):
161- assert_equals (rebot (self .data , outputdir = TEMP , critical = 'nomatch' ), 0 )
162- assert_equals (rebot (self .data , outputdir = TEMP , name = 'New Name' ), 1 )
161+ assert_equal (rebot (self .data , outputdir = TEMP , critical = 'nomatch' ), 0 )
162+ assert_equal (rebot (self .data , outputdir = TEMP , name = 'New Name' ), 1 )
163163 self ._assert_outputs ([(LOG , 2 )])
164164
165165 def test_run_fails (self ):
166- assert_equals (rebot (self .nonex ), 252 )
167- assert_equals (rebot (self .data , outputdir = TEMP ), 1 )
166+ assert_equal (rebot (self .nonex ), 252 )
167+ assert_equal (rebot (self .data , outputdir = TEMP ), 1 )
168168 self ._assert_outputs (stdout = [(LOG , 1 )],
169169 stderr = [('[ ERROR ]' , 1 ), (self .nonex , (1 , 2 )),
170170 ('--help' , 1 )])
171171
172172 def test_custom_stdout (self ):
173173 stdout = StringIO ()
174- assert_equals (rebot (self .data , report = 'None' , stdout = stdout ,
174+ assert_equal (rebot (self .data , report = 'None' , stdout = stdout ,
175175 outputdir = TEMP ), 1 )
176176 self ._assert_output (stdout , [('Log:' , 1 ), ('Report:' , 0 )])
177177 self ._assert_outputs ()
178178
179179 def test_custom_stdout_and_stderr_with_minimal_implementation (self ):
180180 output = StreamWithOnlyWriteAndFlush ()
181- assert_equals (rebot (self .data , log = 'NONE' , report = 'NONE' , stdout = output ,
181+ assert_equal (rebot (self .data , log = 'NONE' , report = 'NONE' , stdout = output ,
182182 stderr = output ), 252 )
183- assert_equals (rebot (self .data , report = 'NONE' , stdout = output ,
183+ assert_equal (rebot (self .data , report = 'NONE' , stdout = output ,
184184 stderr = output , outputdir = TEMP ), 1 )
185185 self ._assert_output (output , [('[ ERROR ] No outputs created' , 1 ),
186186 ('--help' , 1 ), ('Log:' , 1 ), ('Report:' , 0 )])
@@ -194,9 +194,9 @@ def visit_test(self, test):
194194 self .tests .append (test .name )
195195 test .status = 'FAIL'
196196 modifier = Modifier ()
197- assert_equals (rebot (self .data , outputdir = TEMP ,
197+ assert_equal (rebot (self .data , outputdir = TEMP ,
198198 prerebotmodifier = modifier ), 3 )
199- assert_equals (modifier .tests , ['Test 1.1' , 'Test 1.2' , 'Test 2.1' ])
199+ assert_equal (modifier .tests , ['Test 1.1' , 'Test 1.2' , 'Test 2.1' ])
200200
201201
202202class TestStateBetweenTestRuns (RunningTestCase ):
@@ -223,23 +223,23 @@ def _import_resource(self):
223223 def test_clear_namespace_between_runs (self ):
224224 data = join (ROOT , 'atest' , 'testdata' , 'variables' , 'commandline_variables.robot' )
225225 rc = self ._run (data , test = ['NormalText' ], variable = ['NormalText:Hello' ])
226- assert_equals (rc , 0 )
226+ assert_equal (rc , 0 )
227227 rc = self ._run (data , test = ['NormalText' ])
228- assert_equals (rc , 1 )
228+ assert_equal (rc , 1 )
229229
230230 def test_reset_logging_conf (self ):
231- assert_equals (logging .getLogger ().handlers , [])
232- assert_equals (logging .raiseExceptions , 1 )
231+ assert_equal (logging .getLogger ().handlers , [])
232+ assert_equal (logging .raiseExceptions , 1 )
233233 self ._run (join (ROOT , 'atest' , 'testdata' , 'misc' , 'normal.robot' ))
234- assert_equals (logging .getLogger ().handlers , [])
235- assert_equals (logging .raiseExceptions , 1 )
234+ assert_equal (logging .getLogger ().handlers , [])
235+ assert_equal (logging .raiseExceptions , 1 )
236236
237237 def test_listener_unregistration (self ):
238238 listener = join (ROOT , 'utest' , 'resources' , 'Listener.py' )
239- assert_equals (run_without_outputs (self .data , listener = listener + ':1' ), 0 )
239+ assert_equal (run_without_outputs (self .data , listener = listener + ':1' ), 0 )
240240 self ._assert_outputs ([("[from listener 1]" , 1 ), ("[listener close]" , 1 )])
241241 self ._clear_outputs ()
242- assert_equals (run_without_outputs (self .data ), 0 )
242+ assert_equal (run_without_outputs (self .data ), 0 )
243243 self ._assert_outputs ([("[from listener 1]" , 0 ), ("[listener close]" , 0 )])
244244
245245
@@ -259,19 +259,19 @@ def test_different_timestamps_when_run_multiple_times(self):
259259 output21 , output22 = self .find_results (self .output , 2 )
260260 report21 , report22 = self .find_results (self .report , 2 )
261261 log21 , log22 = self .find_results (self .log , 2 )
262- assert_equals (output1 , output21 )
263- assert_equals (report1 , report21 )
264- assert_equals (log1 , log21 )
262+ assert_equal (output1 , output21 )
263+ assert_equal (report1 , report21 )
264+ assert_equal (log1 , log21 )
265265
266266 def run_tests (self ):
267267 data = join (ROOT , 'atest' , 'testdata' , 'misc' , 'pass_and_fail.robot' )
268- assert_equals (run (data , timestampoutputs = True , outputdir = TEMP ,
268+ assert_equal (run (data , timestampoutputs = True , outputdir = TEMP ,
269269 output = 'output-ts.xml' , report = 'report-ts.html' ,
270270 log = 'log-ts' ), 1 )
271271
272272 def find_results (self , pattern , expected ):
273273 matches = glob .glob (pattern )
274- assert_equals (len (matches ), expected )
274+ assert_equal (len (matches ), expected )
275275 return sorted (matches )
276276
277277 def wait_until_next_second (self ):
@@ -290,8 +290,8 @@ def test_original_signal_handlers_are_restored(self):
290290 signal .signal (signal .SIGTERM , my_sigterm )
291291 try :
292292 run_without_outputs (self .data , stdout = StringIO ())
293- assert_equals (signal .getsignal (signal .SIGINT ), orig_sigint )
294- assert_equals (signal .getsignal (signal .SIGTERM ), my_sigterm )
293+ assert_equal (signal .getsignal (signal .SIGINT ), orig_sigint )
294+ assert_equal (signal .getsignal (signal .SIGTERM ), my_sigterm )
295295 finally :
296296 signal .signal (signal .SIGINT , orig_sigint )
297297 signal .signal (signal .SIGTERM , orig_sigterm )
0 commit comments