'threaded auth - PLAIN'

def test_plain(self):

    server = self.socket(zmq.PUSH)
    server.plain_server = True
    client = self.socket(zmq.PULL)
    client.plain_username = 'admin'
    client.plain_password = 'Password'
    self.assertFalse(self.can_connect(server, client))
    server = self.socket(zmq.PUSH)
    server.plain_server = True
    client = self.socket(zmq.PULL)
    client.plain_username = 'admin'
    client.plain_password = 'Password'
    self.auth.configure_plain(domain='*', passwords={'admin': 'Password'})
    self.assertTrue(self.can_connect(server, client))
    server = self.socket(zmq.PUSH)
    server.plain_server = True
    client = self.socket(zmq.PULL)
    client.plain_username = 'admin'
    client.plain_password = 'Bogus'
    self.assertFalse(self.can_connect(server, client))
    self.auth.stop()
    self.auth = None
    server = self.socket(zmq.PUSH)
    client = self.socket(zmq.PULL)
    self.assertTrue(self.can_connect(server, client))
    client.close()
    server.close()
