Exemplo n.º 1
0
 def test_string_output(self):
     """
     Test output to a string.
     """
     got_str = yamlish.dumps(IN)
     got = yaml.load(got_str)
     self.assertEqual(got, self._expected, "Result matches")
Exemplo n.º 2
0
 def test_string_output(self):
     """
     Test output to a string.
     """
     got_str = yamlish.dumps(IN)
     got = yaml.load(got_str)
     self.assertEqual(got, self._expected, "Result matches")
Exemplo n.º 3
0
            passed = False
    elif close_result != 'OK' and close_result != 'INFORMATIONAL':
        passed = False

    # Print the TAP result.
    print(u'{0} {1} - [{2}] {3}{4}'.format('ok' if passed else 'not ok',
                                           count,
                                           test_id,
                                           description,
                                           ' # SKIP unimplemented' if skipped
                                                                   else ''))

    # Print a YAMLish diagnostic for failed tests.
    if report and not passed:
        output = filter_report(report)
        diagnostic = yamlish.dumps(output)
        for line in diagnostic.splitlines():
            print('  ' + line)

    if not passed:
        failed_count += 1
    if skipped:
        skipped_count += 1

# Print a final result.
print('# Autobahn|TestSuite {0}'.format('PASSED' if not failed_count else 'FAILED'))
print('# total {0}'.format(count))
print('# passed {0}'.format(count - failed_count - skipped_count))
print('# skipped {0}'.format(skipped_count))
print('# failed {0}'.format(failed_count))
Exemplo n.º 4
0
 def __unicode__(self):
     return yamlish.dumps(self.data)
Exemplo n.º 5
0
        if test_result == 'UNIMPLEMENTED':
            skipped = True
        else:
            passed = False
    elif close_result != 'OK' and close_result != 'INFORMATIONAL':
        passed = False

    # Print the TAP result.
    print(u'{0} {1} - [{2}] {3}{4}'.format(
        'ok' if passed else 'not ok', count, test_id, description,
        ' # SKIP unimplemented' if skipped else ''))

    # Print a YAMLish diagnostic for failed tests.
    if report and not passed:
        output = filter_report(report)
        diagnostic = yamlish.dumps(output)
        for line in diagnostic.splitlines():
            print('  ' + line)

    if not passed:
        failed_count += 1
    if skipped:
        skipped_count += 1

# Print a final result.
print('# Autobahn|TestSuite {0}'.format(
    'PASSED' if not failed_count else 'FAILED'))
print('# total {0}'.format(count))
print('# passed {0}'.format(count - failed_count - skipped_count))
print('# skipped {0}'.format(skipped_count))
print('# failed {0}'.format(failed_count))
Exemplo n.º 6
0
 def __str__(self):
     return yamlish.dumps(self.data)