示例#1
0
 def test_log_to_stderr(self):
     """Test log_to_file=False property"""
     with patch('gstswitch.server.ProcessMonitor') as mock:
         serv = Server(path='abc')
         serv.log_to_file = False
         serv._start_process('cmd')
         mock.assert_called_with('cmd')
示例#2
0
 def test_log_to_stderr(self):
     """Test log_to_file=False property"""
     with patch("gstswitch.server.ProcessMonitor") as mock:
         serv = Server(path="abc")
         serv.log_to_file = False
         serv._start_process("cmd")
         mock.assert_called_with("cmd")
示例#3
0
 def test_log_to_file(self):
     """Test log_to_file=True property"""
     with patch('gstswitch.server.open', create=True) as mock_open:
         mock_open.return_value = 123
         with patch('gstswitch.server.ProcessMonitor') as mock:
             serv = Server(path='abc')
             serv.log_to_file = True
             serv._start_process('cmd')
             mock.assert_called_with('cmd', 123)
示例#4
0
 def test_log_to_file(self):
     """Test log_to_file=True property"""
     with patch("gstswitch.server.open", create=True) as mock_open:
         mock_open.return_value = 123
         with patch("gstswitch.server.ProcessMonitor") as mock:
             serv = Server(path="abc")
             serv.log_to_file = True
             serv._start_process("cmd")
             mock.assert_called_with("cmd", 123)