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')
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')