'Test that appropriate errors are raised on bad socket options'

def test_bad_sockopts(self):

    s = self.context.socket(zmq.PUB)
    self.sockets.append(s)
    s.setsockopt(zmq.LINGER, 0)
    self.assertRaisesErrno(zmq.EINVAL, s.setsockopt, 9999, 5)
    self.assertRaisesErrno(zmq.EINVAL, s.getsockopt, 9999)
    self.assertRaises(TypeError, s.setsockopt, 9999, '5')
    self.assertRaisesErrno(zmq.EINVAL, s.setsockopt, zmq.SUBSCRIBE, 'hi')
