def METHOD_NAME(self):
    portstr = "tcp:0:interface=127.0.0.1"
    reg = yield self.pbm.register(portstr, "boris", "pass", self.perspectiveFactory)
    # make sure things look right
    self.assertIn(portstr, self.pbm.dispatchers)
    disp = self.pbm.dispatchers[portstr]
    self.assertIn('boris', disp.users)
    # we can't actually connect to it, as that requires finding the
    # dynamically allocated port number which is buried out of reach;
    # however, we can try the requestAvatar and requestAvatarId methods.
    username = yield disp.requestAvatarId(credentials.UsernamePassword(b'boris', b'pass'))
    self.assertEqual(username, b'boris')
    avatar = yield disp.requestAvatar(b'boris', mock.Mock(), pb.IPerspective)
    _, persp, __ = avatar
    self.assertTrue(persp.is_my_persp)
    self.assertIn('boris', self.connections)
    yield reg.unregister()