Exemplo n.º 1
0
    def test_prepare_to_send_with_hash_with__grain(self):
        work_request = WorkRequest()
        work_request.prepare_to_send({
            'action_instance_id': 1,
            'pipeline_instance_id': 2,
            '_grain': 'foobar'
        })

        eq_(1, work_request.action_instance_id)
        eq_(2, work_request.pipeline_instance_id)
        eq_('foobar', work_request.grain)
Exemplo n.º 2
0
    def test_prepare_to_send_with_obj_with__grain(self):
        mock_obj = MagicMock(action_instance_id=1,
                             pipeline_instance_id=2,
                             _grain='foobar')
        del mock_obj.grain

        work_request = WorkRequest()
        work_request.prepare_to_send(mock_obj)

        eq_(1, work_request.action_instance_id)
        eq_(2, work_request.pipeline_instance_id)
        eq_('foobar', work_request.grain)