awips2/pythonPackages/nose/functional_tests/test_success.py
root 8e80217e59 Initial revision of AWIPS2 11.9.0-7p5
Former-commit-id: a02aeb236c [formerly 9f19e3f712] [formerly 06a8b51d6d [formerly 64fa9254b946eae7e61bbc3f513b7c3696c4f54f]]
Former-commit-id: 06a8b51d6d
Former-commit-id: 3360eb6c5f
2012-01-06 08:55:05 -06:00

43 lines
1.2 KiB
Python
Executable file

import os
import unittest
from nose.plugins.plugintest import PluginTester, remove_timings
support = os.path.join(os.path.dirname(__file__), 'support')
class TestSingleTestPass(PluginTester, unittest.TestCase):
activate = '-v'
plugins = []
suitepath = os.path.join(support, 'pass')
def test_single_test_pass(self):
# note that this doesn't use nose.plugins.doctests.run, in order that
# this test fails if the final terminating newline is not present (it
# could still be written as a doctest -- PluginTester was just closer
# to hand)
print self.output
output = remove_timings(str(self.output))
assert output == """\
test.test ... ok
----------------------------------------------------------------------
Ran 1 test in ...s
OK
"""
class TestZeroTestsPass(PluginTester, unittest.TestCase):
activate = '-v'
plugins = []
suitepath = os.path.join(support, 'empty')
def test_zero_tests_pass(self):
print self.output
output = remove_timings(str(self.output))
assert output == """\
----------------------------------------------------------------------
Ran 0 tests in ...s
OK
"""