def test_add_listener_spec(self):
    self.patch_object(self.c, 'write_configuration', name='mock_c_write_configuration')
    self.c.add_listener_spec('udp', 1024, '0.0.0.0', reply_size=50)
    self.assertIn(('udp', 1024), self.c._listeners)
    self.assertEqual(self.c._listeners[('udp', 1024)], {'name': 'base:listen:udp:0.0.0.0:1024', 'ipv4': '0.0.0.0', 'port': 1024, 'protocol': 'udp', 'reply-size': 50})
    self.mock_c_write_configuration.assert_called_once_with()
def test_add_listener_spec(self):
    self.patch_object(self.c, 'write_configuration', name='mock_c_write_configuration')
    self.c.add_listener_spec('udp', 1024, '0.0.0.0', reply_size=50)
    self.assertIn(('udp', 1024), self.c._listeners)
    self.assertEqual(self.c._listeners[('udp', 1024)], {'name': 'base:listen:udp:0.0.0.0:1024', 'ipv4': '0.0.0.0', 'port': 1024, 'protocol': 'udp', 'reply-size': 50})
    self.mock_c_write_configuration.assert_called_once_with()