예제 #1
0
    def test_interactive(self):
        result = core.exe('echo 1', 'i')

        self.assertEqual(result.sreadline(), '1')
        self.assertRaises(StopIteration, result.sreadline)

        self.assertEqual(len(self.stdout_mock.lines), 0)
        self.assertEqual(len(self.stderr_mock.lines), 0)
예제 #2
0
    def test_interactive(self):
        result = core.exe('echo 1', 'i')

        self.assertEqual(result.sreadline(), '1')
        self.assertRaises(StopIteration, result.sreadline)

        self.assertEqual(len(self.stdout_mock.lines), 0)
        self.assertEqual(len(self.stderr_mock.lines), 0)
예제 #3
0
    def test_exe(self):
        result = core.exe('echo 1', '')

        self.assertEqual(result.stdout, '1')
        self.assertEqual(str(result), '1')
        self.assertTrue(result == '1')
        self.assertEqual(result.__bool__(), True)

        self.assertEqual(len(self.stdout_mock.lines), 0)
        self.assertEqual(len(self.stderr_mock.lines), 0)
예제 #4
0
    def test_exe(self):
        result = core.exe('echo 1', '')

        self.assertEqual(result.stdout, '1')
        self.assertEqual(str(result), '1')
        self.assertTrue(result == '1')
        self.assertEqual(result.__bool__(), True)

        self.assertEqual(len(self.stdout_mock.lines), 0)
        self.assertEqual(len(self.stderr_mock.lines), 0)
예제 #5
0
    def test_config_print_all(self):
        core.exe('echo 1', '')

        self.assertEqual(len(self.stdout_mock.lines), 1)
        self.assertEqual(self.stdout_mock.lines[0], '>>> echo 1')
예제 #6
0
    def test_config_print_all(self):
        core.exe('echo 1', '')

        self.assertEqual(len(self.stdout_mock.lines), 1)
        self.assertEqual(self.stdout_mock.lines[0], '>>> echo 1')