tests: make filter-esc tests working also on travis

There stderr is not a tty, so filtering isn't turned on by default. Mock
os.isatty() to fake it.
This commit is contained in:
Marek Marczykowski-Górecki 2017-12-05 22:47:07 +01:00
parent 14b3acec24
commit 5b7ea16808
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -706,6 +706,7 @@ class TC_20_QubesLocal(unittest.TestCase):
with open(tmpdir + '/payload') as payload:
self.assertEqual(payload.read(), 'some payload\n')
@mock.patch('os.isatty', lambda fd: fd == 2)
def test_010_run_service(self):
self.listen_and_send(b'0\0')
with mock.patch('subprocess.Popen') as mock_proc:
@ -733,6 +734,7 @@ class TC_20_QubesLocal(unittest.TestCase):
self.assertEqual(self.get_request(),
b'dom0\0admin.vm.Start\0some-vm\0\0')
@mock.patch('os.isatty', lambda fd: fd == 2)
def test_012_run_service_user(self):
self.listen_and_send(b'0\0')
with mock.patch('subprocess.Popen') as mock_proc: