Revision: 0b0eb9b64d74
Branch: default
Author: Robot Framework Developers ([email protected])
Date: Thu May 30 02:37:46 2013
Log: utest cleanup
http://code.google.com/p/robotframework/source/detail?r=0b0eb9b64d74
Modified:
/utest/api/test_run_and_rebot.py
=======================================
--- /utest/api/test_run_and_rebot.py Thu May 30 02:34:51 2013
+++ /utest/api/test_run_and_rebot.py Thu May 30 02:37:46 2013
@@ -15,6 +15,10 @@
LOG = 'Log: %s' % LOG_PATH
+def run_without_outputs(*args, **kwargs):
+ return run(*args, output='NONE', report='NoNe', log='none', **kwargs)
+
+
class StreamWithOnlyWriteAndFlush(object):
def __init__(self):
@@ -85,8 +89,8 @@
assert exists(LOG_PATH)
def test_run_multiple_times(self):
- assert_equals(run(self.data, output='NONE', report='NoNe',
log='none', critical='nomatch'), 0)
- assert_equals(run(self.data, output='NONE', report='NoNe',
log='none', name='New Name'), 1)
+ assert_equals(run_without_outputs(self.data, critical='nomatch'),
0)
+ assert_equals(run_without_outputs(self.data, name='New Name'), 1)
self._assert_outputs([('Pass And Fail', 2), ('New Name', 2), (LOG,
0)])
def test_run_fails(self):
@@ -98,28 +102,28 @@
def test_custom_stdout(self):
stdout = StringIO()
- assert_equals(run(self.data, output='NONE', report='NoNe',
log='none', stdout=stdout), 1)
+ assert_equals(run_without_outputs(self.data, stdout=stdout), 1)
self._assert_output(stdout, [('Pass And Fail', 2), ('Output:', 1),
('Log:', 0), ('Report:', 0)])
self._assert_outputs()
def test_custom_stderr(self):
stderr = StringIO()
- assert_equals(run(self.warn, output='NONE', report='NoNe',
log='none', stderr=stderr), 0)
+ assert_equals(run_without_outputs(self.warn, stderr=stderr), 0)
self._assert_output(stderr, [('[ WARN ]', 4), ('[ ERROR ]', 1)])
self._assert_outputs([('Warnings And Errors', 2), ('Output:', 1),
('Log:', 0), ('Report:', 0)])
def test_custom_stdout_and_stderr_with_minimal_implementation(self):
output = StreamWithOnlyWriteAndFlush()
- assert_equals(run(self.warn, output='NONE', report='NoNe',
log='none', stdout=output, stderr=output), 0)
+ assert_equals(run_without_outputs(self.warn, stdout=output,
stderr=output), 0)
self._assert_output(output, [('[ WARN ]', 4), ('[ ERROR ]', 1),
('Warnings And Errors', 3),
('Output:', 1),
('Log:', 0), ('Report:', 0)])
self._assert_outputs()
def test_multi_options_as_single_string(self):
- assert_equals(run(self.data, output='NONE', report='NoNe',
log='none', exclude='fail'), 0)
+ assert_equals(run_without_outputs(self.data, exclude='fail'), 0)
self._assert_outputs([('FAIL', 0)])
--
---
You received this message because you are subscribed to the Google Groups "robotframework-commit" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.