Browse Source

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.
Marek Marczykowski-Górecki 6 years ago
parent
commit
5b7ea16808
1 changed files with 2 additions and 0 deletions
  1. 2 0
      qubesadmin/tests/app.py

+ 2 - 0
qubesadmin/tests/app.py

@@ -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: