def test_group_error(self):
     try:
         validate_method_output(method_error_group, 'ERROR error group\n'
                                                    '  PASSED passed step\n'
                                                    '  ERROR error step')
     except Exception as inst:
         eq_(inst, error_exception)
 def test_group_fail(self):
     try:
         validate_method_output(method_fail_group, 'FAILED failed group\n'
                                                   '  PASSED passed step\n'
                                                   '  FAILED failed step')
     except Exception as inst:
         eq_(inst, failure_exception)
Exemple #3
0
 def test_group_fail(self):
     try:
         validate_method_output(
             method_fail_group, 'FAILED failed group\n'
             '  PASSED passed step\n'
             '  FAILED failed step')
     except Exception as inst:
         eq_(inst, failure_exception)
Exemple #4
0
 def test_group_error(self):
     try:
         validate_method_output(
             method_error_group, 'ERROR error group\n'
             '  PASSED passed step\n'
             '  ERROR error step')
     except Exception as inst:
         eq_(inst, error_exception)
Exemple #5
0
 def test_failed(self):
     try:
         work_dir = os.getcwd()
         sep_symbol = '/'
         if '\\' in work_dir:
             sep_symbol = '\\'
         validate_method_output(self.TestObjectFailed('test_failed').test_failed,
                                'FAILED failed step: My Exception\n'
                                '  File "{0}/tests/full_run/test_failed.py", line 15, in test_failed\n'
                                '    self.failed_step()\n'
                                '  File "{0}/grail/steps.py", line 120, in _execute\n'
                                '    output = step_info.run_function()\n'
                                '  File "{0}/grail/step_info.py", line 59, in run_function\n'
                                '    result = self.function(*self.args, **self.kwargs)\n'
                                '  File "{0}/tests/full_run/test_failed.py", line 19, in failed_step\n'
                                '    raise self.to_raise'.replace('/', sep_symbol).format(os.getcwd()))
     except Exception as inst:
         eq_(inst, self.TestObjectFailed.to_raise)
Exemple #6
0
 def test_error(self):
     try:
         work_dir = os.getcwd()
         sep_symbol = '/'
         if '\\' in work_dir:
             sep_symbol = '\\'
         validate_method_output(self.TestObjectFailed('test_error').test_error,
                                'ERROR error step: My Exception\n'
                                '  File "{0}/tests/full_run/test_error.py", line 15, in test_error\n'
                                '    self.error_step()\n'
                                '  File "{0}/grail/steps.py", line 118, in _execute\n'
                                '    output = step_info.run_function()\n'
                                '  File "{0}/grail/step_info.py", line 58, in run_function\n'
                                '    return self.function(*self.args, **self.kwargs)\n'
                                '  File "{0}/tests/full_run/test_error.py", line 19, in error_step\n'
                                '    raise self.to_raise'.replace('/', sep_symbol).format(os.getcwd()))
     except Exception as inst:
         eq_(inst, self.TestObjectFailed.to_raise)
Exemple #7
0
 def test_error(self):
     try:
         work_dir = os.getcwd()
         sep_symbol = '/'
         if '\\' in work_dir:
             sep_symbol = '\\'
         validate_method_output(
             self.TestObjectFailed('test_error').test_error,
             'ERROR error step: My Exception\n'
             '  File "{0}/tests/full_run/test_error.py", line 15, in test_error\n'
             '    self.error_step()\n'
             '  File "{0}/grail/steps.py", line 120, in _execute\n'
             '    output = step_info.run_function()\n'
             '  File "{0}/grail/step_info.py", line 59, in run_function\n'
             '    result = self.function(*self.args, **self.kwargs)\n'
             '  File "{0}/tests/full_run/test_error.py", line 19, in error_step\n'
             '    raise self.to_raise'.replace('/', sep_symbol).format(
                 os.getcwd()))
     except Exception as inst:
         eq_(inst, self.TestObjectFailed.to_raise)
Exemple #8
0
 def test_enabled_output(self):
     validate_method_output(self.step_with_output, 'PASSED step with output -> Printed data')
Exemple #9
0
 def test_step_with_kwargs(self):
     validate_method_output(step_with_kwargs, "step with kwargs (a=b)", kwargs={"a": "b"})
Exemple #10
0
 def test_print_kwargs_params(self):
     validate_method_output(step_with_params, "step with params (some_string=42)", kwargs={"some_string": "42"})
Exemple #11
0
 def test_step_group(self):
     validate_method_output(step_group, "step group\n" "  simple step\n" "  pending step")
Exemple #12
0
 def test_step_disabling_with_params(self):
     validate_method_output(self.disabled_step_params, u'Some data after params')
Exemple #13
0
 def test_ingore_output(self):
     validate_method_output(self.method_with_two_groups, 'FAILED pass fail ignore group\n'
                                                         '  PASSED step1\n'
                                                         '  FAILED fail step: Explicit error\n'
                                                         '  IGNORED ignored step\n'
                                                         'IGNORED pass fail ignore group')
Exemple #14
0
 def test_returning_unicode(self):
     validate_method_output(self.step_with_returning_unicode, u'PASSED step with returning unicode -> Привет!!!')
Exemple #15
0
 def test_step_disabling(self):
     validate_method_output(self.disabled_step, u'Some data')
Exemple #16
0
 def test_disabled_input_logging(self):
     validate_method_output(self.step_with_not_logged_input, 'PASSED step with not logged input', ['data'])
Exemple #17
0
 def test_enabled_input_logging(self):
     validate_method_output(self.step_with_logged_input, 'PASSED step with logged input (data)', ['data'])
Exemple #18
0
 def test_disabled_output(self):
     validate_method_output(self.step_with_disabled_output, 'PASSED step with disabled output')
Exemple #19
0
 def test_format_params(self):
     validate_method_output(step_with_format_params,
                            'Some info \'None\' kw42',
                            args=(None, ),
                            kwargs={'kw_str': 'kw42'})
Exemple #20
0
 def test_passed_flow(self):
     validate_method_output(self.some_step_group,
                            'PASSED some step group\n'
                            '  PASSED step1\n'
                            '  PASSED step2')
Exemple #21
0
 def test_step_with_args(self):
     validate_method_output(step_with_args,
                            'step with args',
                            args=(None, None))
Exemple #22
0
 def test_explicit_disable(self):
     validate_method_output(self.explicit_step_call_skip,
                            'PASSED explicit step call skip')
Exemple #23
0
 def test_print_args_params(self):
     validate_method_output(step_with_params, "step with params (42)", args=("42",))
Exemple #24
0
 def test_localization_exception(self):
     validate_method_output(self.verify_step, u'PASSED verify step (\ufffd\ufffd\ufffd, \ufffd\ufffd)\n'
                                              u'  \ufffd\ufffd\ufffd\ufffd\ufffd',
                            args=(korean_string, russian_string))
Exemple #25
0
 def test_format_params(self):
     validate_method_output(
         step_with_format_params, "Some info 'None' kw42", args=(None,), kwargs={"kw_str": "kw42"}
     )
Exemple #26
0
 def test_dict_params(self):
     validate_method_output(self.eq_dict, u'PASSED eq dict ({}, {})', args=({}, {}))
Exemple #27
0
 def test_step_with_args(self):
     validate_method_output(step_with_args, "step with args", args=(None, None))
Exemple #28
0
 def test_simple_output(self):
     validate_method_output(simple_step, 'simple step')
Exemple #29
0
 def test_step_time(self):
     validate_method_output(self.some_step, '[0.50s] PASSED some step')
Exemple #30
0
 def test_description(self):
     validate_method_output(step_with_description, 'Some Description')
Exemple #31
0
 def test_three_statuses(self):
     validate_method_output(self.pass_fail_ignore_group, 'FAILED pass fail ignore group\n'
                                                         '  PASSED step1\n'
                                                         '  FAILED fail step: Explicit error\n'
                                                         '  IGNORED ignored step')
Exemple #32
0
 def test_print_args_params(self):
     validate_method_output(step_with_params,
                            'step with params (42)',
                            args=('42', ))
Exemple #33
0
 def test_pending_export(self):
     validate_method_output(self.TestObjectPendingExport('test_pending_export').test_pending_export, 'pending step')
Exemple #34
0
 def test_pending_status(self):
     validate_method_output(self.pass_pending_ignore_group, 'PENDING pass pending ignore group\n'
                                                            '  PASSED step1\n'
                                                            '  PENDING pending step\n'
                                                            '  IGNORED ignored step')
Exemple #35
0
 def test_pending_output(self):
     validate_method_output(pending_step, 'pending step')
Exemple #36
0
 def test_passed(self):
     validate_method_output(self.TestObjectPassed('test_passed').test_passed, 'PASSED passed step')
Exemple #37
0
 def test_skip_none_params(self):
     validate_method_output(step_with_params, 'step with params')
Exemple #38
0
 def test_simple_output(self):
     validate_method_output(simple_step, "simple step")
Exemple #39
0
 def test_print_kwargs_params(self):
     validate_method_output(step_with_params,
                            'step with params (some_string=42)',
                            kwargs={'some_string': '42'})
Exemple #40
0
 def test_pending_output(self):
     validate_method_output(pending_step, "pending step")
Exemple #41
0
 def test_step_group(self):
     validate_method_output(
         step_group, 'step group\n'
         '  simple step\n'
         '  pending step')
Exemple #42
0
 def test_description(self):
     validate_method_output(step_with_description, "Some Description")
Exemple #43
0
 def test_step_with_kwargs(self):
     validate_method_output(step_with_kwargs,
                            'step with kwargs (a=b)',
                            kwargs={'a': 'b'})
Exemple #44
0
 def test_skip_none_params(self):
     validate_method_output(step_with_params, "step with params")