def test_create(self):
        sess = mock.Mock()
        obj = mock.Mock()
        fake_attrs = [{'foo': 'bar'}, {'zoo': 'lah'}]
        obj.json = mock.Mock(return_value=fake_attrs)
        sess.post = mock.Mock(return_value=obj)
        sot = claim.Claim()

        c = claim.Claim.new(client_id=CLIENT, queue_name=QUEUE, **FAKE)
        list(sot.claim_messages(sess, c))

        url = '/queues/%s/claims' % QUEUE
        sess.post.assert_called_with(
            url, endpoint_filter=sot.service,
            headers={'Client-ID': CLIENT}, params=None,
            data=json.dumps(FAKE, cls=claim.ClaimEncoder))
dataset/ETHPy150Open openstack/python-openstacksdk/openstack/tests/unit/message/v1/test_claim.py/TestClaim.test_create/original