Exemplo n.º 1
0
    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, '')
Exemplo n.º 2
0
    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, '')
Exemplo n.º 3
0
    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')
Exemplo n.º 4
0
    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')