def test_fromElementSubscribeWithOptions(self):

        xml = """
        <iq type='set' to='pubsub.example.org'
                       from='user@example.org'>
          <pubsub xmlns='http://jabber.org/protocol/pubsub'>
            <subscribe node='test' jid='user@example.org/Home'/>
            <options>
              <x xmlns="jabber:x:data" type='submit'>
                <field var='FORM_TYPE' type='hidden'>
                  <value>http://jabber.org/protocol/pubsub#subscribe_options</value>
                </field>
                <field var='pubsub#deliver' type='boolean'
                       label='Enable delivery?'>
                  <value>1</value>
                </field>
              </x>
            </options>
          </pubsub>
        </iq>
        """

        request = pubsub.PubSubRequest.fromElement(parseXml(xml))
        self.assertEqual('subscribe', request.verb)
        request.options.typeCheck({'pubsub#deliver': {'type': 'boolean'}})
        self.assertEqual({'pubsub#deliver': True}, request.options.getValues())
Test parsing a subscription request.
dataset/ETHPy150Open ralphm/wokkel/wokkel/test/test_pubsub.py/PubSubRequestTest.test_fromElementSubscribeWithOptions