Ejemplo n.º 1
0
    def test_noargs(self):
        config = {}
        slaves = [
            mock.Mock(),
            mock.Mock(),
            mock.Mock(),
        ]
        sd = mock.Mock(config=config, slaves=slaves)

        subway.forward(sd, 'test', None)

        for slave in slaves:
            slave.publish.assert_called_once_with('control', 'test')
Ejemplo n.º 2
0
    def test_withargs_altchan(self):
        config = {'channel': 'alternate'}
        slaves = [
            mock.Mock(),
            mock.Mock(),
            mock.Mock(),
        ]
        sd = mock.Mock(config=config, slaves=slaves)

        subway.forward(sd, 'test', 'arguments:for:test')

        for slave in slaves:
            slave.publish.assert_called_once_with(
                'alternate', 'test:arguments:for:test')