Ejemplo n.º 1
0
    def test_invoke_args(self):
        func = Mock()
        retval = Mock()

        with patch('%s.paginate_query' % pbm) as mock_paginate:
            mock_paginate.return_value = retval
            res = boto_query_wrapper(func, 'foo', 'bar')
        assert res == retval
        assert mock_paginate.mock_calls == [call(func, 'foo', 'bar')]
Ejemplo n.º 2
0
    def test_invoke_kwargs_alc(self):
        func = Mock()
        retval = Mock()

        with patch('%s.paginate_query' % pbm) as mock_paginate:
            mock_paginate.return_value = retval
            res = boto_query_wrapper(func, 'foo', bar='barval',
                                     baz='bazval', alc_foo='alcfoo',
                                     alc_bar='alcbar')
        assert res == retval
        assert mock_paginate.mock_calls == [
            call(func, 'foo', bar='barval', baz='bazval', alc_foo='alcfoo',
                 alc_bar='alcbar')
        ]