def test_stopService(self):
        slave = self.createBuildslave()
        yield slave.startService()

        config = mock.Mock()
        config.protocols = {'pb': {'port': 'tcp:1234'}}
        config.slaves = [slave]

        yield slave.reconfigService(config)
        yield slave.stopService()

        self.assertEqual(self.master.pbmanager._unregistrations,
                         [('tcp:1234', 'bot')])
        self.assertEqual(self.master.pbmanager._registrations,
                         [('tcp:1234', 'bot', 'pass')])
    def test_stopService(self):
        slave = self.createBuildslave()
        yield slave.startService()

        config = mock.Mock()
        config.protocols = {'pb': {'port': 'tcp:1234'}}
        config.slaves = [slave]

        yield slave.reconfigService(config)
        yield slave.stopService()

        self.assertEqual(self.master.pbmanager._unregistrations,
                         [('tcp:1234', 'bot')])
        self.assertEqual(self.master.pbmanager._registrations,
                         [('tcp:1234', 'bot', 'pass')])
    def test_stopService(self):
        slave = self.createBuildslave()
        yield slave.startService()

        config = mock.Mock()
        config.protocols = {'pb': {'port': 'tcp:1234'}}
        config.slaves = [slave]

        yield slave.reconfigService(config)

        reg = slave.registration

        yield slave.stopService()

        self.assertTrue(reg.unregistered)
        self.assertEqual(slave.registration, None)
    def test_stopService(self):
        slave = self.createBuildslave()
        yield slave.startService()

        config = mock.Mock()
        config.protocols = {'pb': {'port': 'tcp:1234'}}
        config.slaves = [slave]

        yield slave.reconfigService(config)

        reg = slave.registration

        yield slave.stopService()

        self.assertTrue(reg.unregistered)
        self.assertEqual(slave.registration, None)