1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
# -*- mode:python; coding:utf-8 -*-
import logging
import unittest
import atheist
import atheist_mock
logging.info("using %s" % atheist.__file__)
class TestOuts(unittest.TestCase):
def setUp(self):
self.mng = atheist_mock.MockManager()
def test_stdout_wrong_type_None(self):
try:
atheist.Test(self.mng, 'echo', stdout=None)
except TypeError:
return
raise Exception
def test_stdout_wrong_type_int(self):
try:
atheist.Test(self.mng, 'echo', stdout=0)
except TypeError:
return
raise Exception
def test_stderr_wrong_type_None(self):
try:
atheist.Test(self.mng, 'echo', stderr=None)
except TypeError:
return
raise Exception
def test_stderr_wrong_type_int(self):
try:
atheist.Test(self.mng, 'echo', stderr=0)
except TypeError:
return
raise Exception
def test_stdout_implies_save_stdout(self):
test = atheist.Test(self.mng, 'echo', stdout='hola')
self.assert_(test.save_stdout == True)
def test_stderr_implies_save_stderr(self):
test = atheist.Test(self.mng, 'echo', stderr='hola')
self.assert_(test.save_stderr == True)
UnitTestCase(TestOuts)
|