Ejemplo n.º 1
0
 def test_match_int9(self):
   mock_meth = unittest.mock.MagicMock()
   self.dispatcher.map("/debug", mock_meth)
   osc_server._UDPHandler(
       [_SIMPLE_PARAM_INT_9, None], self.client_address, self.server)
   self.assertTrue(mock_meth.called)
   mock_meth.assert_called_with("/debug", 9)
Ejemplo n.º 2
0
 def test_match_int9(self):
     mock_meth = unittest.mock.MagicMock()
     self.dispatcher.map("/debug", mock_meth)
     osc_server._UDPHandler([_SIMPLE_PARAM_INT_9, None],
                            self.client_address, self.server)
     self.assertTrue(mock_meth.called)
     mock_meth.assert_called_with("/debug", 9)
Ejemplo n.º 3
0
 def test_match_default_handler(self):
     mock_meth = unittest.mock.MagicMock()
     self.dispatcher.set_default_handler(mock_meth)
     osc_server._UDPHandler([_SIMPLE_MSG_NO_PARAMS, None],
                            self.client_address, self.server)
     mock_meth.assert_called_with("/SYNC")
Ejemplo n.º 4
0
 def test_match_with_args(self):
     mock_meth = unittest.mock.MagicMock()
     self.dispatcher.map("/SYNC", mock_meth, 1, 2, 3)
     osc_server._UDPHandler([_SIMPLE_PARAM_INT_MSG, None],
                            self.client_address, self.server)
     mock_meth.assert_called_with("/SYNC", [1, 2, 3], 4)
Ejemplo n.º 5
0
 def test_no_match(self):
     mock_meth = unittest.mock.MagicMock()
     self.dispatcher.map("/foobar", mock_meth)
     osc_server._UDPHandler([_SIMPLE_PARAM_INT_MSG, None],
                            self.client_address, self.server)
     self.assertFalse(mock_meth.called)
Ejemplo n.º 6
0
 def test_match_default_handler(self):
   mock_meth = unittest.mock.MagicMock()
   self.dispatcher.set_default_handler(mock_meth)
   osc_server._UDPHandler(
       [_SIMPLE_MSG_NO_PARAMS, None], self.client_address, self.server)
   mock_meth.assert_called_with("/SYNC")
Ejemplo n.º 7
0
 def test_match_with_args(self):
   mock_meth = unittest.mock.MagicMock()
   self.dispatcher.map("/SYNC", mock_meth, 1, 2, 3)
   osc_server._UDPHandler(
       [_SIMPLE_PARAM_INT_MSG, None], self.client_address, self.server)
   mock_meth.assert_called_with("/SYNC", [1, 2, 3], 4)
Ejemplo n.º 8
0
 def test_no_match(self):
   mock_meth = unittest.mock.MagicMock()
   self.dispatcher.map("/foobar", mock_meth)
   osc_server._UDPHandler(
       [_SIMPLE_PARAM_INT_MSG, None], self.client_address, self.server)
   self.assertFalse(mock_meth.called)