示例#1
0
文件: tests.py 项目: svisser/shell
    def test__handle_output_norecord(self):
        sh = Shell(record_output=False, record_errors=False)
        self.assertEqual(sh._stdout, '')
        self.assertEqual(sh._stderr, '')

        sh._handle_output('another.txt\n', 'Error: Please supply an arg.')
        self.assertEqual(sh._stdout, '')
        self.assertEqual(sh._stderr, '')
示例#2
0
文件: tests.py 项目: GiorgosPa/shell
    def test__handle_output_norecord(self):
        sh = Shell(record_output=False, record_errors=False)
        self.assertEqual(sh._stdout, '')
        self.assertEqual(sh._stderr, '')

        sh._handle_output('another.txt\n', 'Error: Please supply an arg.')
        self.assertEqual(sh._stdout, '')
        self.assertEqual(sh._stderr, '')
示例#3
0
文件: tests.py 项目: svisser/shell
    def test__handle_output_simple(self):
        sh = Shell()
        self.assertEqual(sh._stdout, '')
        self.assertEqual(sh._stderr, '')

        sh._handle_output('another.txt\n', None)
        self.assertEqual(sh._stdout, 'another.txt\n')
        self.assertEqual(sh._stderr, '')

        sh._handle_output('something.txt\n', 'Error: Please supply an arg.\n')
        self.assertEqual(sh._stdout, 'another.txt\nsomething.txt\n')
        self.assertEqual(sh._stderr, 'Error: Please supply an arg.\n')
示例#4
0
文件: tests.py 项目: GiorgosPa/shell
    def test__handle_output_simple(self):
        sh = Shell()
        self.assertEqual(sh._stdout, '')
        self.assertEqual(sh._stderr, '')

        sh._handle_output('another.txt\n', None)
        self.assertEqual(sh._stdout, 'another.txt\n')
        self.assertEqual(sh._stderr, '')

        sh._handle_output('something.txt\n', 'Error: Please supply an arg.\n')
        self.assertEqual(sh._stdout, 'another.txt\nsomething.txt\n')
        self.assertEqual(sh._stderr, 'Error: Please supply an arg.\n')