case-1.5.3+dfsg.orig/0000755000175000017500000000000013054235754013643 5ustar mans0954mans0954case-1.5.3+dfsg.orig/setup.py0000644000175000017500000000644012776774114015371 0ustar mans0954mans0954#!/usr/bin/env python # -*- coding: utf-8 -*- import setuptools import os import re import sys import codecs if sys.version_info < (2, 6): raise Exception('case requires Python 2.6 or higher.') NAME = 'case' # -*- Classifiers -*- classes = """ Development Status :: 5 - Production/Stable Programming Language :: Python Programming Language :: Python :: 2 Programming Language :: Python :: 2.7 Programming Language :: Python :: 2.6 Programming Language :: Python :: 3 Programming Language :: Python :: 3.3 Programming Language :: Python :: 3.4 Programming Language :: Python :: 3.5 License :: OSI Approved :: BSD License Intended Audience :: Developers Operating System :: OS Independent """ classifiers = [s.strip() for s in classes.split('\n') if s] # -*- Distribution Meta -*- re_meta = re.compile(r'__(\w+?)__\s*=\s*(.*)') re_doc = re.compile(r'^"""(.+?)"""') def add_default(m): attr_name, attr_value = m.groups() return ((attr_name, attr_value.strip("\"'")),) def add_doc(m): return (('doc', m.groups()[0]),) pats = {re_meta: add_default, re_doc: add_doc} here = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(here, 'case/__init__.py')) as meta_fh: meta = {} for line in meta_fh: if line.strip() == '# -eof meta-': break for pattern, handler in pats.items(): m = pattern.match(line.strip()) if m: meta.update(handler(m)) # -*- Parsing Requirement Files -*- py_version = sys.version_info is_jython = sys.platform.startswith('java') is_pypy = hasattr(sys, 'pypy_version_info') def strip_comments(l): return l.split('#', 1)[0].strip() def _pip_requirement(req): if req.startswith('-r '): _, path = req.split() return reqs(*path.split('/')) return [req] def _reqs(*f): return [ _pip_requirement(r) for r in ( strip_comments(l) for l in open( os.path.join(os.getcwd(), 'requirements', *f)).readlines() ) if r] def reqs(*f): return [req for subreq in _reqs(*f) for req in subreq] # -*- Install Requires -*- install_requires = reqs('default.txt') if sys.version_info[0] >= 3: if is_pypy: install_requires.extend(reqs('pypy3.txt')) else: install_requires.extend(reqs('py2.txt')) if sys.version_info < (2, 7): install_requires.extend(reqs('py26.txt')) # -*- Tests Requires -*- tests_require = reqs('test.txt') # -*- Long Description -*- if os.path.exists('README.rst'): long_description = codecs.open('README.rst', 'r', 'utf-8').read() else: long_description = 'See http://pypi.python.org/pypi/case/' # -*- %%% -*- setuptools.setup( name=NAME, version=meta['version'], description=meta['doc'], keywords='test unit testing pytest unittest mock patch', author=meta['author'], author_email=meta['contact'], url=meta['homepage'], platforms=['any'], license='BSD', zip_safe=False, install_requires=install_requires, tests_require=tests_require, test_suite='nose.collector', classifiers=classifiers, long_description=long_description, entry_points={ 'pytest11': ['case = case.pytest'], }, packages=setuptools.find_packages( exclude=['ez_setup', 'tests', 'tests.*'], ), ) case-1.5.3+dfsg.orig/PKG-INFO0000644000175000017500000000742213053417144014737 0ustar mans0954mans0954Metadata-Version: 1.1 Name: case Version: 1.5.3 Summary: Python unittest Utilities Home-page: http://github.com/celery/case Author: Ask Solem Author-email: ask@celeryproject.org License: BSD Description: ===================================================================== Python unittest utilities ===================================================================== |build-status| |coverage| |license| |wheel| |pyversion| |pyimp| :Version: 1.5.3 :Web: http://case.readthedocs.org/ :Download: http://pypi.python.org/pypi/case/ :Source: http://github.com/celery/case/ :Keywords: testing utilities, python, unittest, mock About ===== .. _case-installation: Installation ============ You can install case either via the Python Package Index (PyPI) or from source. To install using `pip`,:: $ pip install -U case To install using `easy_install`,:: $ easy_install -U case .. _case-installing-from-source: Downloading and installing from source -------------------------------------- Download the latest version of case from http://pypi.python.org/pypi/case/ You can install it by doing the following,:: $ tar xvfz case-0.0.0.tar.gz $ cd case-0.0.0 $ python setup.py build # python setup.py install The last command must be executed as a privileged user if you are not currently using a virtualenv. .. _case-installing-from-git: Using the development version ----------------------------- With pip ~~~~~~~~ You can install the latest snapshot of case using the following pip command:: $ pip install https://github.com/celery/case/zipball/master#egg=case .. |build-status| image:: https://secure.travis-ci.org/celery/case.png?branch=master :alt: Build status :target: https://travis-ci.org/celery/case .. |coverage| image:: https://codecov.io/github/celery/case/coverage.svg?branch=master :target: https://codecov.io/github/celery/case?branch=master .. |license| image:: https://img.shields.io/pypi/l/case.svg :alt: BSD License :target: https://opensource.org/licenses/BSD-3-Clause .. |wheel| image:: https://img.shields.io/pypi/wheel/case.svg :alt: Case can be installed via wheel :target: http://pypi.python.org/pypi/case/ .. |pyversion| image:: https://img.shields.io/pypi/pyversions/case.svg :alt: Supported Python versions. :target: http://pypi.python.org/pypi/case/ .. |pyimp| image:: https://img.shields.io/pypi/implementation/case.svg :alt: Support Python implementations. :target: http://pypi.python.org/pypi/case/ Keywords: test unit testing pytest unittest mock patch Platform: any Classifier: Development Status :: 5 - Production/Stable Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.3 Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: License :: OSI Approved :: BSD License Classifier: Intended Audience :: Developers Classifier: Operating System :: OS Independent case-1.5.3+dfsg.orig/MANIFEST.in0000644000175000017500000000020712736024711015373 0ustar mans0954mans0954include README.rst Changelog LICENSE recursive-include docs * recursive-include extra README *.py recursive-include requirements *.txt case-1.5.3+dfsg.orig/setup.cfg0000644000175000017500000000031013053417144015450 0ustar mans0954mans0954[nosetests] where = case/tests [flake8] ignore = N806, N802, N801, N803 [pep257] ignore = D102,D104,D203,D105,D213 [wheel] universal = 1 [egg_info] tag_build = tag_date = 0 tag_svn_revision = 0 case-1.5.3+dfsg.orig/case/0000755000175000017500000000000013053417144014550 5ustar mans0954mans0954case-1.5.3+dfsg.orig/case/mock.py0000644000175000017500000004432113053416312016053 0ustar mans0954mans0954from __future__ import absolute_import, unicode_literals import importlib import inspect import logging import os import platform import sys import time import types from contextlib import contextmanager from functools import wraps from six import reraise, string_types, iteritems as items from six.moves import builtins from .utils import WhateverIO, decorator, get_logger_handlers, noop try: from importlib import reload except ImportError: try: from imp import reload except ImportError: reload = reload try: from unittest import mock except ImportError: import mock # noqa PY3 = sys.version_info[0] >= 3 if PY3: open_fqdn = 'builtins.open' module_name_t = str else: open_fqdn = '__builtin__.open' # noqa module_name_t = bytes # noqa __all__ = [ 'ANY', 'ContextMock', 'MagicMock', 'Mock', 'MockCallbacks', 'call', 'patch', 'sentinel', 'wrap_logger', 'environ', 'sleepdeprived', 'mask_modules', 'mute', 'stdouts', 'replace_module_value', 'sys_version', 'pypy_version', 'platform_pyimp', 'sys_platform', 'reset_modules', 'module', 'open', 'restore_logging', 'module_exists', 'create_patcher', ] ANY = mock.ANY call = mock.call sentinel = mock.sentinel def create_patcher(*partial_path): def patcher(name, *args, **kwargs): return patch(".".join(partial_path + (name, )), *args, **kwargs) return patcher class MockMixin(object): def on_nth_call_do(self, side_effect, n=1): """Change Mock side effect after ``n`` calls. Example:: mock.on_nth_call_do(RuntimeError, n=3) """ def on_call(*args, **kwargs): if self.call_count >= n: self.side_effect = side_effect return self.return_value self.side_effect = on_call return self def on_nth_call_do_raise(self, excA, excB, n=1): """Change exception raised after ``n`` calls. Mock will raise excA until called `n` times, which after it will raise excB'. Example:: >>> mock.on_nth_call_do_raise(KeyError(), RuntimError(), n=3) >>> mock() KeyError() >>> mock() KeyError() >>> mock() KeyError() >>> mock() RuntimeError() """ def on_call(*args, **kwargs): if self.call_count >= n: self.side_effect = excB raise excA self.side_effect = on_call return self def on_nth_call_return(self, retval, n=1): """Change Mock to return specific return value after ``n`` calls. Example:: mock.on_nth_call_return('STOP', n=3) """ def on_call(*args, **kwargs): if self.call_count >= n: self.return_value = retval return self.return_value self.side_effect = on_call return self def _mock_update_attributes(self, attrs={}, **kwargs): for key, value in items(attrs): setattr(self, key, value) def assert_not_called(_mock_self): # noqa """assert that the mock was never called.""" self = _mock_self if self.call_count != 0: msg = ("Expected '%s' to not have been called. Called %s times." % (self._mock_name or 'mock', self.call_count)) raise AssertionError(msg) def assert_called(_mock_self): # noqa """assert that the mock was called at least once.""" self = _mock_self if self.call_count == 0: msg = ("Expected '%s' to have been called." % self._mock_name or 'mock') raise AssertionError(msg) def assert_called_once(_mock_self): # noqa """assert that the mock was called only once.""" self = _mock_self if not self.call_count == 1: msg = ("Expected '%s' to have been called once. Called %s times." % (self._mock_name or 'mock', self.call_count)) raise AssertionError(msg) class Mock(mock.Mock, MockMixin): def __init__(self, *args, **kwargs): super(Mock, self).__init__(*args, **kwargs) self._mock_update_attributes(**kwargs) class MagicMock(mock.MagicMock, MockMixin): def __init__(self, *args, **kwargs): super(MagicMock, self).__init__(*args, **kwargs) self._mock_update_attributes(**kwargs) class _ContextMock(Mock): """Dummy class implementing __enter__ and __exit__ as the :keyword:`with` statement requires these to be implemented in the class, not just the instance.""" def __enter__(self): return self def __exit__(self, *exc_info): pass def ContextMock(*args, **kwargs): """Mock that mocks :keyword:`with` statement contexts.""" obj = _ContextMock(*args, **kwargs) obj.attach_mock(_ContextMock(), '__enter__') obj.attach_mock(_ContextMock(), '__exit__') obj.__enter__.return_value = obj # if __exit__ return a value the exception is ignored, # so it must return None here. obj.__exit__.return_value = None return obj def _patch_sig1(target, new=None, spec=None, create=None, spec_set=None, autospec=None, new_callable=None, **kwargs): # signature for mock.patch, # used to inject new `new_callable` argument default. return new, autospec, new_callable def _patch_sig2(target, attribute, new=None, spec=None, create=False, spec_set=None, autospec=None, new_callable=None, **kwargs): # signature for mock.patch.multiple + mock.patch.object, # used to inject new `new_callable` argument default. return new, autospec, new_callable def _patch_sig_multiple(target, spec=None, create=False, spec_set=None, autospec=None, new_callable=None, **kwargs): # New is always set, don't have to specify new_callable return True, autospec, new_callable def _create_patcher(fun, signature): @wraps(fun) def patcher(*args, **kwargs): new, autospec, new_callable = signature(*args, **kwargs) if new is None and autospec is None and new_callable is None: kwargs.setdefault('new_callable', MagicMock) return fun(*args, **kwargs) return patcher patch = _create_patcher(mock.patch, _patch_sig1) patch.dict = mock.patch.dict patch.multiple = _create_patcher(mock.patch.multiple, _patch_sig_multiple) patch.object = _create_patcher(mock.patch.object, _patch_sig2) patch.stopall = mock.patch.stopall patch.TEST_PREFIX = mock.patch.TEST_PREFIX def _bind(f, o): @wraps(f) def bound_meth(*fargs, **fkwargs): return f(o, *fargs, **fkwargs) return bound_meth if PY3: # pragma: no cover def _get_class_fun(meth): return meth def module_name(s): if isinstance(s, bytes): return s.decode() return s else: def _get_class_fun(meth): # noqa return meth.__func__ def module_name(s): # noqa if isinstance(s, unicode): return s.encode() return s class MockCallbacks(object): def __new__(cls, *args, **kwargs): r = Mock(name=cls.__name__) _get_class_fun(cls.__init__)(r, *args, **kwargs) for key, value in items(vars(cls)): if key not in ('__dict__', '__weakref__', '__new__', '__init__'): if inspect.ismethod(value) or inspect.isfunction(value): r.__getattr__(key).side_effect = _bind(value, r) else: r.__setattr__(key, value) return r @decorator def wrap_logger(logger, loglevel=logging.ERROR): """Wrap :class:`logging.Logger` with a StringIO() handler. yields a StringIO handle. Example:: with mock.wrap_logger(logger, loglevel=logging.DEBUG) as sio: ... sio.getvalue() """ old_handlers = get_logger_handlers(logger) sio = WhateverIO() siohandler = logging.StreamHandler(sio) logger.handlers = [siohandler] try: yield sio finally: logger.handlers = old_handlers @decorator def environ(env_name, env_value): """Mock environment variable value. Example:: @mock.environ('DJANGO_SETTINGS_MODULE', 'proj.settings') def test_other_settings(self): ... """ sentinel = object() prev_val = os.environ.get(env_name, sentinel) os.environ[env_name] = env_value try: yield finally: if prev_val is sentinel: os.environ.pop(env_name, None) else: os.environ[env_name] = prev_val @decorator def sleepdeprived(module=time): """Mock time.sleep to do nothing. Example:: @mock.sleepdeprived() # < patches time.sleep @mock.sleepdeprived(celery.result) # < patches celery.result.sleep """ old_sleep, module.sleep = module.sleep, noop try: yield finally: module.sleep = old_sleep # Taken from # http://bitbucket.org/runeh/snippets/src/tip/missing_modules.py @decorator def mask_modules(*modnames): """Ban some modules from being importable inside the context For example:: >>> with mask_modules('sys'): ... try: ... import sys ... except ImportError: ... print('sys not found') sys not found >>> import sys # noqa >>> sys.version (2, 5, 2, 'final', 0) Or as a decorator:: @mask_modules('sys') def test_foo(self): ... """ realimport = builtins.__import__ def myimp(name, *args, **kwargs): if name in modnames: raise ImportError('No module named %s' % name) else: return realimport(name, *args, **kwargs) builtins.__import__ = myimp try: yield finally: builtins.__import__ = realimport @decorator def stdouts(): """Override `sys.stdout` and `sys.stderr` with `StringIO` instances. Decorator example:: @mock.stdouts def test_foo(self, stdout, stderr): something() self.assertIn('foo', stdout.getvalue()) Context example:: with mock.stdouts() as (stdout, stderr): something() self.assertIn('foo', stdout.getvalue()) """ prev_out, prev_err = sys.stdout, sys.stderr prev_rout, prev_rerr = sys.__stdout__, sys.__stderr__ mystdout, mystderr = WhateverIO(), WhateverIO() sys.stdout = sys.__stdout__ = mystdout sys.stderr = sys.__stderr__ = mystderr try: yield mystdout, mystderr finally: sys.stdout = prev_out sys.stderr = prev_err sys.__stdout__ = prev_rout sys.__stderr__ = prev_rerr @decorator def mute(): """Redirect `sys.stdout` and `sys.stderr` to /dev/null, silencent them. Decorator example:: @mock.mute def test_foo(self): something() Context example:: with mock.mute(): something() """ prev_out, prev_err = sys.stdout, sys.stderr prev_rout, prev_rerr = sys.__stdout__, sys.__stderr__ devnull = open(os.devnull, 'w') mystdout, mystderr = devnull, devnull sys.stdout = sys.__stdout__ = mystdout sys.stderr = sys.__stderr__ = mystderr try: yield finally: sys.stdout = prev_out sys.stderr = prev_err sys.__stdout__ = prev_rout sys.__stderr__ = prev_rerr @decorator def replace_module_value(module, name, value=None): """Mock module value, given a module, attribute name and value. Decorator example:: @mock.replace_module_value(module, 'CONSTANT', 3.03) def test_foo(self): ... Context example:: with mock.replace_module_value(module, 'CONSTANT', 3.03): ... """ has_prev = hasattr(module, name) prev = getattr(module, name, None) if value: setattr(module, name, value) else: try: delattr(module, name) except AttributeError: pass try: yield finally: if prev is not None: setattr(module, name, prev) if not has_prev: try: delattr(module, name) except AttributeError: pass def sys_version(value=None): """Mock :data:`sys.version_info` Decorator example:: @mock.sys_version((3, 6, 1)) def test_foo(self): ... Context example:: with mock.sys_version((3, 6, 1)): ... """ return replace_module_value(sys, 'version_info', value) def pypy_version(value=None): """Mock :data:`sys.pypy_version_info` Decorator example:: @mock.pypy_version((3, 6, 1)) def test_foo(self): ... Context example:: with mock.pypy_version((3, 6, 1)): ... """ return replace_module_value(sys, 'pypy_version_info', value) def platform_pyimp(value=None): """Mock :data:`platform.python_implementation` Decorator example:: @mock.platform_pyimp('PyPy') def test_foo(self): ... Context example:: with mock.platform_pyimp('PyPy'): ... """ return replace_module_value(platform, 'python_implementation', value) @decorator def sys_platform(value=None): """Mock :data:`sys.platform` Decorator example:: @mock.sys_platform('darwin') def test_foo(self): ... Context example:: with mock.sys_platform('darwin'): ... """ prev, sys.platform = sys.platform, value try: yield finally: sys.platform = prev @decorator def reset_modules(*modules): """Remove modules from :data:`sys.modules` by name, and reset back again when the test/context returns. Decorator example:: @mock.reset_modules('celery.result', 'celery.app.base') def test_foo(self): pass Context example:: with mock.reset_modules('celery.result', 'celery.app.base'): pass """ prev = dict((k, sys.modules.pop(k)) for k in modules if k in sys.modules) try: for k in modules: reload(importlib.import_module(k)) yield finally: sys.modules.update(prev) @decorator def module(*names): """Mock one or modules such that every attribute is a :class:`Mock`.""" prev = {} class MockModule(types.ModuleType): def __getattr__(self, attr): setattr(self, attr, Mock()) return types.ModuleType.__getattribute__(self, attr) mods = [] for name in names: try: prev[name] = sys.modules[name] except KeyError: pass mod = sys.modules[name] = MockModule(module_name(name)) mods.append(mod) try: yield mods finally: for name in names: try: sys.modules[name] = prev[name] except KeyError: try: del(sys.modules[name]) except KeyError: pass @contextmanager def mock_context(mock, typ=Mock): context = mock.return_value = Mock() context.__enter__ = typ() context.__exit__ = typ() def on_exit(*x): if x[0]: reraise(x[0], x[1], x[2]) context.__exit__.side_effect = on_exit context.__enter__.return_value = context try: yield context finally: context.reset() @decorator def open(typ=WhateverIO, side_effect=None): """Patch builtins.open so that it returns StringIO object. :param typ: File object for open to return. Defaults to :class:`WhateverIO` which is the bastard child of :class:`io.StringIO` and :class:`io.BytesIO` accepting both bytes and unicode input. :param side_effect: Additional side effect for when the open context is entered. Decorator example:: @mock.open() def test_foo(self, open_fh): something_opening_and_writing_a_file() self.assertIn('foo', open_fh.getvalue()) Context example:: with mock.open(io.BytesIO) as open_fh: something_opening_and_writing_bytes_to_a_file() self.assertIn(b'foo', open_fh.getvalue()) """ with patch(open_fqdn) as open_: with mock_context(open_) as context: if side_effect is not None: context.__enter__.side_effect = side_effect val = context.__enter__.return_value = typ() val.__exit__ = Mock() yield val @decorator def restore_logging(): """Restore root logger handlers after test returns. Decorator example:: @mock.restore_logging() def test_foo(self): setup_logging() Context example:: with mock.restore_logging(): setup_logging() """ outs = sys.stdout, sys.stderr, sys.__stdout__, sys.__stderr__ root = logging.getLogger() level = root.level handlers = root.handlers try: yield finally: sys.stdout, sys.stderr, sys.__stdout__, sys.__stderr__ = outs root.level = level root.handlers[:] = handlers @decorator def module_exists(*modules): """Patch one or more modules to ensure they exist. A module name with multiple paths (e.g. gevent.monkey) will ensure all parent modules are also patched (``gevent`` + ``gevent.monkey``). Decorator example:: @mock.module_exists('gevent.monkey') def test_foo(self): pass Context example:: with mock.module_exists('gevent.monkey'): gevent.monkey.patch_all = Mock(name='patch_all') ... """ gen = [] old_modules = [] for module in modules: if isinstance(module, string_types): module = types.ModuleType(module_name(module)) gen.append(module) if module.__name__ in sys.modules: old_modules.append(sys.modules[module.__name__]) sys.modules[module.__name__] = module name = module.__name__ if '.' in name: parent, _, attr = name.rpartition('.') setattr(sys.modules[parent], attr, module) try: yield finally: for module in gen: sys.modules.pop(module.__name__, None) for module in old_modules: sys.modules[module.__name__] = module case-1.5.3+dfsg.orig/case/case.py0000644000175000017500000002206712736024711016045 0ustar mans0954mans0954from __future__ import absolute_import, unicode_literals import re import sys import types import warnings from contextlib import contextmanager from functools import partial from six import string_types, itervalues as values, iteritems as items from . import mock try: import unittest # noqa unittest.skip from unittest.util import safe_repr, unorderable_list_difference except AttributeError: import unittest2 as unittest # noqa from unittest2.util import safe_repr, unorderable_list_difference # noqa __all__ = ['Case'] # -- adds assertWarns from recent unittest2, not in Python 2.7. class _AssertRaisesBaseContext(object): def __init__(self, expected, test_case, callable_obj=None, expected_regex=None): self.expected = expected self.failureException = test_case.failureException self.obj_name = None if isinstance(expected_regex, string_types): expected_regex = re.compile(expected_regex) self.expected_regex = expected_regex def _is_magic_module(m): # some libraries create custom module types that are lazily # lodaded, e.g. Django installs some modules in sys.modules that # will load _tkinter and other shit when touched. # pyflakes refuses to accept 'noqa' for this isinstance. cls, modtype = type(m), types.ModuleType try: variables = vars(cls) except TypeError: return True else: return (cls is not modtype and ( '__getattr__' in variables or '__getattribute__' in variables)) class _AssertWarnsContext(_AssertRaisesBaseContext): """A context manager used to implement TestCase.assertWarns* methods.""" def __enter__(self): # The __warningregistry__'s need to be in a pristine state for tests # to work properly. warnings.resetwarnings() for v in list(values(sys.modules)): # do not evaluate Django moved modules and other lazily # initialized modules. if v and not _is_magic_module(v): # use raw __getattribute__ to protect even better from # lazily loaded modules try: object.__getattribute__(v, '__warningregistry__') except AttributeError: pass else: object.__setattr__(v, '__warningregistry__', {}) self.warnings_manager = warnings.catch_warnings(record=True) self.warnings = self.warnings_manager.__enter__() warnings.simplefilter('always', self.expected) return self def __exit__(self, exc_type, exc_value, tb): self.warnings_manager.__exit__(exc_type, exc_value, tb) if exc_type is not None: # let unexpected exceptions pass through return try: exc_name = self.expected.__name__ except AttributeError: exc_name = str(self.expected) first_matching = None for m in self.warnings: w = m.message if not isinstance(w, self.expected): continue if first_matching is None: first_matching = w if (self.expected_regex is not None and not self.expected_regex.search(str(w))): continue # store warning for later retrieval self.warning = w self.filename = m.filename self.lineno = m.lineno return # Now we simply try to choose a helpful failure message if first_matching is not None: raise self.failureException( '%r does not match %r' % ( self.expected_regex.pattern, str(first_matching))) if self.obj_name: raise self.failureException( '%s not triggered by %s' % (exc_name, self.obj_name)) else: raise self.failureException('%s not triggered' % exc_name) class CaseMixin(object): """Mixin class that adds the utility methods to any unittest TestCase class.""" def patch(self, *path, **options): """Patch object until test case returns. Example:: from case import Case class test_Frobulator(Case): def setup(self): frobulate = self.patch('some.where.Frobulator.frobulate') """ manager = mock.patch('.'.join(path), **options) patched = manager.start() self.addCleanup(manager.stop) return patched def mock_modules(self, *mods): """Mock modules for the duration of the test. See :func:`case.mock.module` """ modules = [] for mod in mods: mod = mod.split('.') modules.extend(reversed([ '.'.join(mod[:-i] if i else mod) for i in range(len(mod)) ])) modules = sorted(set(modules)) return self.wrap_context(mock.module(*modules)) def mask_modules(self, *modules): """Make modules for the duration of the test. See :func:`case.mock.mask_modules`. """ self.wrap_context(mock.mask_modules(*modules)) def wrap_context(self, context): """Wrap context so that the context exits when the test completes.""" ret = context.__enter__() self.addCleanup(partial(context.__exit__, None, None, None)) return ret def mock_environ(self, env_name, env_value): """Mock environment variable value for the duration of the test. See :func:`case.mock.environ`. """ return self.wrap_context(mock.environ(env_name, env_value)) class Case(unittest.TestCase, CaseMixin): """Test Case Subclass of :class:`unittest.TestCase` adding convenience methods. **setup / teardown** New :meth:`setup` and :meth:`teardown` methods can be defined in addition to the core :meth:`setUp` + :meth:`tearDown` methods. Note: If you redefine the core :meth:`setUp` + :meth:`tearDown` methods you must make sure ``super`` is called. ``super`` is not necessary for the lowercase versions. **Python 2.6 compatibility** This class also implements :meth:`assertWarns`, :meth:`assertWarnsRegex`, :meth:`assertDictContainsSubset`, and :meth:`assertItemsEqual` which are not available in the original Python 2.6 unittest implementation. """ DeprecationWarning = DeprecationWarning PendingDeprecationWarning = PendingDeprecationWarning def setUp(self): self.setup() def tearDown(self): self.teardown() def setup(self): pass def teardown(self): pass def assertWarns(self, expected_warning): return _AssertWarnsContext(expected_warning, self, None) def assertWarnsRegex(self, expected_warning, expected_regex): return _AssertWarnsContext(expected_warning, self, None, expected_regex) @contextmanager def assertDeprecated(self): with self.assertWarnsRegex(self.DeprecationWarning, r'scheduled for removal'): yield @contextmanager def assertPendingDeprecation(self): with self.assertWarnsRegex(self.PendingDeprecationWarning, r'scheduled for deprecation'): yield def assertDictContainsSubset(self, expected, actual, msg=None): missing, mismatched = [], [] for key, value in items(expected): if key not in actual: missing.append(key) elif value != actual[key]: mismatched.append('%s, expected: %s, actual: %s' % ( safe_repr(key), safe_repr(value), safe_repr(actual[key]))) if not (missing or mismatched): return standard_msg = '' if missing: standard_msg = 'Missing: %s' % ','.join(map(safe_repr, missing)) if mismatched: if standard_msg: standard_msg += '; ' standard_msg += 'Mismatched values: %s' % ( ','.join(mismatched)) self.fail(self._formatMessage(msg, standard_msg)) def assertItemsEqual(self, expected_seq, actual_seq, msg=None): missing = unexpected = None try: expected = sorted(expected_seq) actual = sorted(actual_seq) except TypeError: # Unsortable items (example: set(), complex(), ...) expected = list(expected_seq) actual = list(actual_seq) missing, unexpected = unorderable_list_difference( expected, actual) else: return self.assertSequenceEqual(expected, actual, msg=msg) errors = [] if missing: errors.append( 'Expected, but missing:\n %s' % (safe_repr(missing),) ) if unexpected: errors.append( 'Unexpected, but present:\n %s' % (safe_repr(unexpected),) ) if errors: standardMsg = '\n'.join(errors) self.fail(self._formatMessage(msg, standardMsg)) case-1.5.3+dfsg.orig/case/tests/0000755000175000017500000000000013053417144015712 5ustar mans0954mans0954case-1.5.3+dfsg.orig/case/tests/__init__.py0000644000175000017500000000000012736024711020012 0ustar mans0954mans0954case-1.5.3+dfsg.orig/case/__init__.py0000644000175000017500000000174513053417003016662 0ustar mans0954mans0954"""Python unittest Utilities""" from __future__ import absolute_import, unicode_literals import re from collections import namedtuple from .case import Case from .mock import ANY, ContextMock, MagicMock, Mock, call, patch, sentinel from . import mock from . import skip __version__ = '1.5.3' __author__ = 'Ask Solem' __contact__ = 'ask@celeryproject.org' __homepage__ = 'http://github.com/celery/case' __docformat__ = 'restructuredtext' # -eof meta- version_info_t = namedtuple('version_info_t', ( 'major', 'minor', 'micro', 'releaselevel', 'serial' )) # bumpversion can only search for {current_version} # so we have to parse the version here. _temp = re.match( r'(\d+)\.(\d+).(\d+)(.+)?', __version__).groups() VERSION = version_info = version_info_t( int(_temp[0]), int(_temp[1]), int(_temp[2]), _temp[3] or '', '') del(_temp) del(re) __all__ = [ b'Case', b'ANY', b'ContextMock', b'MagicMock', b'Mock', b'call', b'patch', b'sentinel', b'mock', b'skip', ] case-1.5.3+dfsg.orig/case/skip.py0000644000175000017500000001642313004755355016103 0ustar mans0954mans0954from __future__ import absolute_import, unicode_literals import importlib import os import sys from nose import SkipTest from .utils import decorator, symbol_by_name __all__ = [ 'todo', 'if_darwin', 'unless_darwin', 'if_environ', 'unless_environ', 'if_module', 'unless_module', 'if_jython', 'unless_jython', 'if_platform', 'unless_platform', 'if_pypy', 'unless_pypy', 'if_python3', 'unless_python3', 'if_win32', 'unless_win32', 'if_symbol', 'unless_symbol', 'if_python_version_after', 'if_python_version_before', ] @decorator def if_python_version_before(*version, **kwargs): """Skip test if Python version is less than ``*version``. Example:: # skips test if running on Python < 3.1 @skip.if_python_version_before(3, 1) """ if sys.version_info < version: raise SkipTest('python < {0}: {1}'.format( '.'.join(map(str, version)), kwargs.get('reason') or 'incompatible')) yield @decorator def if_python_version_after(*version, **kwargs): """Skip test if Python version is greater or equal to ``*version``. Example:: # skips test if running on Python >= 3.5 @skip.if_python_version_after(3, 5) """ if sys.version_info >= version: raise SkipTest('python >= {0}: {1}'.format( '.'.join(map(str, version)), kwargs.get('reason') or 'incompatible')) yield def if_python3(*version, **kwargs): """Skip test if Python version is 3 or later. Example:: @skip.if_python3(reason='does not have buffer type') """ return if_python_version_after(3, *version, **kwargs) def unless_python3(*version, **kwargs): """Skip test if Python version is Python 2 or earlier. Example:: @skip.unless_python3() """ return if_python_version_before(3, *version, **kwargs) @decorator def if_environ(env_var_name): """Skip test if environment variable ``env_var_name`` is defined. Example:: @skip.if_environ('SKIP_SLOW_TESTS') """ if os.environ.get(env_var_name): raise SkipTest('envvar {0} set'.format(env_var_name)) yield @decorator def unless_environ(env_var_name): """Skip test if environment variable ``env_var_name`` is undefined. Example:: @skip.unless_environ('LOCALE') """ if not os.environ.get(env_var_name): raise SkipTest('envvar {0} not set'.format(env_var_name)) yield @decorator def _skip_test(reason, sign): raise SkipTest('{0}: {1}'.format(sign, reason)) def todo(reason): """Skip test flagging case as TODO. Example:: @skip.todo(reason='broken test') """ return _skip_test(reason, sign='TODO') def skip(reason): return _skip_test(reason, sign='SKIP') @decorator def if_module(module, name=None, import_errors=(ImportError,)): """Skip test if ``module`` can be imported. :param module: Module to import. :keyword name: Alternative module name to use in reason. :keyword import_errors: Tuple of import errors to check for. Default is ``(ImportError,)``. Example:: @skip.if_module('librabbitmq') """ try: importlib.import_module(module) except import_errors: pass else: raise SkipTest('module available: {0}'.format(name or module)) yield @decorator def unless_module(module, name=None, import_errors=(ImportError,)): """Skip test if ``module`` can not be imported. :param module: Module to import. :keyword name: Alternative module name to use in reason. :keyword import_errors: Tuple of import errors to check for. Default is ``(ImportError,)``. Example:: @skip.unless_module('librabbitmq') """ try: importlib.import_module(module) except import_errors: raise SkipTest('module not installed: {0}'.format(name or module)) yield @decorator def if_symbol(symbol, name=None, import_errors=(AttributeError, ImportError)): """Skip test if ``symbol`` can be imported. :param module: Symbol to import. :keyword name: Alternative symbol name to use in reason. :keyword import_errors: Tuple of import errors to check for. Default is ``(AttributeError, ImportError,)``. Example:: @skip.if_symbol('django.db.transaction:on_commit') """ try: symbol_by_name(symbol) except import_errors: pass else: raise SkipTest('symbol exists: {0}'.format(name or symbol)) yield @decorator def unless_symbol(symbol, name=None, import_errors=(AttributeError, ImportError)): """Skip test if ``symbol`` cannot be imported. :param module: Symbol to import. :keyword name: Alternative symbol name to use in reason. :keyword import_errors: Tuple of import errors to check for. Default is ``(AttributeError, ImportError,)``. Example:: @skip.unless_symbol('django.db.transaction:on_commit') """ try: symbol_by_name(symbol) except import_errors: raise SkipTest('missing symbol: {0}'.format(name or symbol)) yield @decorator def if_platform(platform_name, name=None): """Skip test if :data:`sys.platform` name matches ``platform_name``. :param platform_name: Name to match with :data:`sys.platform`. :keyword name: Alternative name to use in reason. Example:: @skip.if_platform('netbsd', name='NetBSD') """ if sys.platform.startswith(platform_name): raise SkipTest('does not work on {0}'.format(platform_name or name)) yield def if_jython(): """Skip test if running under Jython. Example:: @skip.if_jython() """ return if_platform('java', name='Jython') def if_win32(): """Skip test if running under Windows. Example:: @skip.if_win32() """ return if_platform('win32', name='Windows') def if_darwin(): """Skip test if running under OS X. Example:: @skip.if_darwin() """ return if_platform('darwin', name='OS X') @decorator def unless_platform(platform_name, name=None): """Skip test if :data:`sys.platform` name does not match ``platform_name``. :param platform_name: Name to match with :data:`sys.platform`. :keyword name: Alternative name to use in reason. Example:: @skip.unless_platform('netbsd', name='NetBSD') """ if not sys.platform.startswith(platform_name): raise SkipTest('only applicable on {0}'.format(platform_name or name)) yield def unless_jython(): """Skip test if not running under Jython.""" return unless_platform('java', name='Jython') def unless_win32(): """Skip test if not running under Windows.""" return unless_platform('win32', name='Windows') def unless_darwin(): """Skip test if not running under OS X.""" return unless_platform('darwin', name='OS X') @decorator def if_pypy(reason='does not work on PyPy'): """Skip test if running on PyPy. Example:: @skip.if_pypy() """ if getattr(sys, 'pypy_version_info', None): raise SkipTest(reason) yield @decorator def unless_pypy(reason='only applicable for PyPy'): """Skip test if not running on PyPy. Example:: @skip.unless_pypy() """ if not hasattr(sys, 'pypy_version_info'): raise SkipTest(reason) yield case-1.5.3+dfsg.orig/case/pytest.py0000644000175000017500000001021113046464506016453 0ustar mans0954mans0954from __future__ import absolute_import, unicode_literals import pytest import sys from functools import wraps from six import iteritems as items from . import patch from . import mock sentinel = object() class fixture_with_options(object): """Pytest fixture with options specified in separate decrorator. The decorated fixture MUST take the request fixture as first argument, but is free to use other fixtures. Example: @fixture_with_options() def sftp(request, username='test_username', password='test_password'): return {'username': username, 'password': password} @sftp.options(username='foo', password='bar') def test_foo(sftp): assert sftp['username'] == 'foo' assert sftp['password'] == 'bar' """ def __init__(self, marker_name=None): self.marker_name = marker_name def __call__(self, fun): marker_name = self.marker_name or fun.__name__ @pytest.fixture() @wraps(fun) def _inner(request, *args, **kwargs): marker = request.node.get_marker(marker_name) print(request.node) return fun(request, *args, **dict(marker.kwargs, **kwargs)) def options(*args, **kwargs): return getattr(pytest.mark, marker_name)(*args, **kwargs) _inner.options = options _inner.__wrapped__ = fun return _inner class _patching(object): def __init__(self, monkeypatch, request): self.monkeypatch = monkeypatch self.request = request def __getattr__(self, name): return getattr(self.monkeypatch, name) def __call__(self, path, value=sentinel, name=None, new=mock.MagicMock, **kwargs): value = self._value_or_mock(value, new, name, path, **kwargs) self.monkeypatch.setattr(path, value) return value def object(self, target, attribute, *args, **kwargs): return _wrap_context( patch.object(target, attribute, *args, **kwargs), self.request) def _value_or_mock(self, value, new, name, path, **kwargs): if value is sentinel: value = new(name=name or path.rpartition('.')[2]) for k, v in items(kwargs): setattr(value, k, v) return value def setattr(self, target, name=sentinel, value=sentinel, **kwargs): # alias to __call__ with the interface of pytest.monkeypatch.setattr if value is sentinel: value, name = name, None return self(target, value, name=name) def setitem(self, dic, name, value=sentinel, new=mock.MagicMock, **kwargs): # same as pytest.monkeypatch.setattr but default value is MagicMock value = self._value_or_mock(value, new, name, dic, **kwargs) self.monkeypatch.setitem(dic, name, value) return value def modules(self, *mods): modules = [] for mod in mods: mod = mod.split('.') modules.extend(reversed([ '.'.join(mod[:-i] if i else mod) for i in range(len(mod)) ])) modules = sorted(set(modules)) return _wrap_context(mock.module(*modules), self.request) def _wrap_context(context, request): ret = context.__enter__() def fin(): context.__exit__(*sys.exc_info()) request.addfinalizer(fin) return ret @pytest.fixture() def patching(monkeypatch, request): """Monkeypath.setattr shortcut. Example: .. code-block:: python def test_foo(patching): # execv value here will be mock.MagicMock by default. execv = patching('os.execv') patching('sys.platform', 'darwin') # set concrete value patching.setenv('DJANGO_SETTINGS_MODULE', 'x.settings') # val will be of type mock.MagicMock by default val = patching.setitem('path.to.dict', 'KEY') """ return _patching(monkeypatch, request) class _stdouts(object): def __init__(self, stdout, stderr): self.stdout = stdout self.stderr = stderr @pytest.fixture() def stdouts(request): return _stdouts(*_wrap_context(mock.stdouts(), request)) case-1.5.3+dfsg.orig/case/utils.py0000644000175000017500000001516713004755153016275 0ustar mans0954mans0954from __future__ import absolute_import, unicode_literals import functools import importlib import inspect import io import logging import sys import unittest from contextlib import contextmanager from six import reraise, string_types __all__ = [ 'WhateverIO', 'decorator', 'get_logger_handlers', 'noop', 'symbol_by_name', ] StringIO = io.StringIO _SIO_write = StringIO.write _SIO_init = StringIO.__init__ def update_wrapper(wrapper, wrapped, *args, **kwargs): wrapper = functools.update_wrapper(wrapper, wrapped, *args, **kwargs) wrapper.__wrapped__ = wrapped return wrapper def wraps(wrapped, assigned=functools.WRAPPER_ASSIGNMENTS, updated=functools.WRAPPER_UPDATES): return functools.partial(update_wrapper, wrapped=wrapped, assigned=assigned, updated=updated) class _CallableContext(object): def __init__(self, context, cargs, ckwargs, fun): self.context = context self.cargs = cargs self.ckwargs = ckwargs self.fun = fun def __call__(self, *args, **kwargs): return self.fun(*args, **kwargs) def __enter__(self): self.ctx = self.context(*self.cargs, **self.ckwargs) return self.ctx.__enter__() def __exit__(self, *einfo): if self.ctx: return self.ctx.__exit__(*einfo) def is_unittest_testcase(cls): try: cls.mro except AttributeError: pass # py.test uses old style classes else: return issubclass(cls, unittest.TestCase) def augment_setup(orig_setup, context, pargs, pkwargs): def around_setup_method(self, *args, **kwargs): try: contexts = self.__rb3dc_contexts__ except AttributeError: contexts = self.__rb3dc_contexts = [] p = context(*pargs, **pkwargs) p.__enter__() contexts.append(p) if orig_setup: return orig_setup(self, *args, **kwargs) if orig_setup: around_setup_method = wraps(orig_setup)(around_setup_method) around_setup_method.__wrapped__ = orig_setup return around_setup_method def augment_teardown(orig_teardown, context, pargs, pkwargs): def around_teardown(self, *args, **kwargs): try: contexts = self.__rb3dc_contexts__ except AttributeError: pass else: for context in contexts: context.__exit__(*sys.exc_info()) if orig_teardown: orig_teardown(self, *args, **kwargs) if orig_teardown: around_teardown = wraps(orig_teardown)(around_teardown) around_teardown.__wrapped__ = orig_teardown return around_teardown def decorator(predicate): context = contextmanager(predicate) @wraps(predicate) def take_arguments(*pargs, **pkwargs): @wraps(predicate) def decorator(cls): if inspect.isclass(cls): if is_unittest_testcase(cls): orig_setup = cls.setUp orig_teardown = cls.tearDown cls.setUp = augment_setup( orig_setup, context, pargs, pkwargs) cls.tearDown = augment_teardown( orig_teardown, context, pargs, pkwargs) else: # py.test orig_setup = getattr(cls, 'setup_method', None) orig_teardown = getattr(cls, 'teardown_method', None) cls.setup_method = augment_setup( orig_setup, context, pargs, pkwargs) cls.teardown_method = augment_teardown( orig_teardown, context, pargs, pkwargs) return cls else: @wraps(cls) def around_case(*args, **kwargs): with context(*pargs, **pkwargs) as context_args: context_args = context_args or () if not isinstance(context_args, tuple): context_args = (context_args,) return cls(*args + context_args, **kwargs) return around_case if len(pargs) == 1 and callable(pargs[0]): fun, pargs = pargs[0], () return decorator(fun) return _CallableContext(context, pargs, pkwargs, decorator) assert take_arguments.__wrapped__ return take_arguments def get_logger_handlers(logger): return [ h for h in logger.handlers if not isinstance(h, logging.NullHandler) ] def symbol_by_name(name, aliases={}, imp=None, package=None, sep='.', default=None, **kwargs): """Get symbol by qualified name. The name should be the full dot-separated path to the class:: modulename.ClassName Example:: celery.concurrency.processes.TaskPool ^- class name or using ':' to separate module and symbol:: celery.concurrency.processes:TaskPool If `aliases` is provided, a dict containing short name/long name mappings, the name is looked up in the aliases first. Examples: >>> symbol_by_name('celery.concurrency.processes.TaskPool') >>> symbol_by_name('default', { ... 'default': 'celery.concurrency.processes.TaskPool'}) # Does not try to look up non-string names. >>> from celery.concurrency.processes import TaskPool >>> symbol_by_name(TaskPool) is TaskPool True """ if imp is None: imp = importlib.import_module if not isinstance(name, string_types): return name # already a class name = aliases.get(name) or name sep = ':' if ':' in name else sep module_name, _, cls_name = name.rpartition(sep) if not module_name: cls_name, module_name = None, package if package else cls_name try: try: module = imp(module_name, package=package, **kwargs) except ValueError as exc: reraise(ValueError, ValueError("Couldn't import {0!r}: {1}".format(name, exc)), sys.exc_info()[2]) return getattr(module, cls_name) if cls_name else module except (ImportError, AttributeError): if default is None: raise return default class WhateverIO(StringIO): def __init__(self, v=None, *a, **kw): _SIO_init(self, v.decode() if isinstance(v, bytes) else v, *a, **kw) def write(self, data): _SIO_write(self, data.decode() if isinstance(data, bytes) else data) def noop(*args, **kwargs): pass case-1.5.3+dfsg.orig/requirements/0000755000175000017500000000000013053417144016360 5ustar mans0954mans0954case-1.5.3+dfsg.orig/requirements/py2.txt0000644000175000017500000000004212736024711017630 0ustar mans0954mans0954-r deps/mock.txt unittest2>=0.5.1 case-1.5.3+dfsg.orig/requirements/deps/0000755000175000017500000000000013053417144017313 5ustar mans0954mans0954case-1.5.3+dfsg.orig/requirements/deps/nose.txt0000644000175000017500000000001412736024711021014 0ustar mans0954mans0954nose>=1.3.7 case-1.5.3+dfsg.orig/requirements/deps/mock.txt0000644000175000017500000000001212736024711020777 0ustar mans0954mans0954mock>=2.0 case-1.5.3+dfsg.orig/requirements/default.txt0000644000175000017500000000004512736024711020545 0ustar mans0954mans0954six setuptools>=0.7 -r deps/nose.txt case-1.5.3+dfsg.orig/requirements/test.txt0000644000175000017500000000001612736024711020076 0ustar mans0954mans0954coverage>=3.0 case-1.5.3+dfsg.orig/requirements/pypy3.txt0000644000175000017500000000002112736024711020177 0ustar mans0954mans0954-r deps/mock.txt case-1.5.3+dfsg.orig/requirements/test-ci.txt0000644000175000017500000000002612736024711020470 0ustar mans0954mans0954coverage>=3.0 codecov case-1.5.3+dfsg.orig/requirements/pkgutils.txt0000644000175000017500000000014512736024711020764 0ustar mans0954mans0954setuptools>=20.6.7 wheel>=0.29.0 flake8>=2.5.4 flakeplus>=1.1 tox>=2.3.1 sphinx2rst>=1.0 bumpversion case-1.5.3+dfsg.orig/requirements/py26.txt0000644000175000017500000000001212736024711017713 0ustar mans0954mans0954importlib case-1.5.3+dfsg.orig/requirements/docs.txt0000644000175000017500000000003212773265315020055 0ustar mans0954mans0954sphinx_celery>=1.1 pytest case-1.5.3+dfsg.orig/LICENSE0000644000175000017500000000463512736024711014653 0ustar mans0954mans0954Copyright (c) 2012-2016 Ask Solem & contributors. All rights reserved. CASE is licensed under The BSD License (3 Clause, also known as the new BSD license). The license is an OSI approved Open Source license and is GPL-compatible(1). The license text can also be found here: http://www.opensource.org/licenses/BSD-3-Clause License ======= Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Ask Solem, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Ask Solem OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Documentation License ===================== The documentation portion of CASE (the rendered contents of the "docs" directory of a software distribution or checkout) is supplied under the "Creative Commons Attribution-ShareAlike 4.0 International" (CC BY-SA 4.0) License as described by http://creativecommons.org/licenses/by-sa/4.0/ Footnotes ========= (1) A GPL-compatible license makes it possible to combine CASE with other software that is released under the GPL, it does not mean that we're distributing CASE under the GPL license. The BSD license, unlike the GPL, let you distribute a modified version without making your changes open source. case-1.5.3+dfsg.orig/docs/0000755000175000017500000000000013053417144014565 5ustar mans0954mans0954case-1.5.3+dfsg.orig/docs/make.bat0000644000175000017500000001646412736024711016206 0ustar mans0954mans0954@ECHO OFF REM Command file for Sphinx documentation if "%SPHINXBUILD%" == "" ( set SPHINXBUILD=sphinx-build ) set BUILDDIR=_build set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . set I18NSPHINXOPTS=%SPHINXOPTS% . if NOT "%PAPER%" == "" ( set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% ) if "%1" == "" goto help if "%1" == "help" ( :help echo.Please use `make ^` where ^ is one of echo. html to make standalone HTML files echo. dirhtml to make HTML files named index.html in directories echo. singlehtml to make a single large HTML file echo. pickle to make pickle files echo. json to make JSON files echo. htmlhelp to make HTML files and a HTML help project echo. qthelp to make HTML files and a qthelp project echo. devhelp to make HTML files and a Devhelp project echo. epub to make an epub echo. epub3 to make an epub3 echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter echo. text to make text files echo. man to make manual pages echo. texinfo to make Texinfo files echo. gettext to make PO message catalogs echo. changes to make an overview over all changed/added/deprecated items echo. xml to make Docutils-native XML files echo. pseudoxml to make pseudoxml-XML files for display purposes echo. linkcheck to check all external links for integrity echo. doctest to run all doctests embedded in the documentation if enabled echo. coverage to run coverage check of the documentation if enabled goto end ) if "%1" == "clean" ( for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i del /q /s %BUILDDIR%\* goto end ) REM Check if sphinx-build is available and fallback to Python version if any %SPHINXBUILD% 1>NUL 2>NUL if errorlevel 9009 goto sphinx_python goto sphinx_ok :sphinx_python set SPHINXBUILD=python -m sphinx.__init__ %SPHINXBUILD% 2> nul if errorlevel 9009 ( echo. echo.The 'sphinx-build' command was not found. Make sure you have Sphinx echo.installed, then set the SPHINXBUILD environment variable to point echo.to the full path of the 'sphinx-build' executable. Alternatively you echo.may add the Sphinx directory to PATH. echo. echo.If you don't have Sphinx installed, grab it from echo.http://sphinx-doc.org/ exit /b 1 ) :sphinx_ok if "%1" == "html" ( %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html if errorlevel 1 exit /b 1 echo. echo.Build finished. The HTML pages are in %BUILDDIR%/html. goto end ) if "%1" == "dirhtml" ( %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml if errorlevel 1 exit /b 1 echo. echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. goto end ) if "%1" == "singlehtml" ( %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml if errorlevel 1 exit /b 1 echo. echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. goto end ) if "%1" == "pickle" ( %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can process the pickle files. goto end ) if "%1" == "json" ( %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can process the JSON files. goto end ) if "%1" == "htmlhelp" ( %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can run HTML Help Workshop with the ^ .hhp project file in %BUILDDIR%/htmlhelp. goto end ) if "%1" == "qthelp" ( %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can run "qcollectiongenerator" with the ^ .qhcp project file in %BUILDDIR%/qthelp, like this: echo.^> qcollectiongenerator %BUILDDIR%\qthelp\PROJ.qhcp echo.To view the help file: echo.^> assistant -collectionFile %BUILDDIR%\qthelp\PROJ.ghc goto end ) if "%1" == "devhelp" ( %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp if errorlevel 1 exit /b 1 echo. echo.Build finished. goto end ) if "%1" == "epub" ( %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub if errorlevel 1 exit /b 1 echo. echo.Build finished. The epub file is in %BUILDDIR%/epub. goto end ) if "%1" == "epub3" ( %SPHINXBUILD% -b epub3 %ALLSPHINXOPTS% %BUILDDIR%/epub3 if errorlevel 1 exit /b 1 echo. echo.Build finished. The epub3 file is in %BUILDDIR%/epub3. goto end ) if "%1" == "latex" ( %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex if errorlevel 1 exit /b 1 echo. echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. goto end ) if "%1" == "latexpdf" ( %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex cd %BUILDDIR%/latex make all-pdf cd %~dp0 echo. echo.Build finished; the PDF files are in %BUILDDIR%/latex. goto end ) if "%1" == "latexpdfja" ( %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex cd %BUILDDIR%/latex make all-pdf-ja cd %~dp0 echo. echo.Build finished; the PDF files are in %BUILDDIR%/latex. goto end ) if "%1" == "text" ( %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text if errorlevel 1 exit /b 1 echo. echo.Build finished. The text files are in %BUILDDIR%/text. goto end ) if "%1" == "man" ( %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man if errorlevel 1 exit /b 1 echo. echo.Build finished. The manual pages are in %BUILDDIR%/man. goto end ) if "%1" == "texinfo" ( %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo if errorlevel 1 exit /b 1 echo. echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. goto end ) if "%1" == "gettext" ( %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale if errorlevel 1 exit /b 1 echo. echo.Build finished. The message catalogs are in %BUILDDIR%/locale. goto end ) if "%1" == "changes" ( %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes if errorlevel 1 exit /b 1 echo. echo.The overview file is in %BUILDDIR%/changes. goto end ) if "%1" == "linkcheck" ( %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck if errorlevel 1 exit /b 1 echo. echo.Link check complete; look for any errors in the above output ^ or in %BUILDDIR%/linkcheck/output.txt. goto end ) if "%1" == "doctest" ( %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest if errorlevel 1 exit /b 1 echo. echo.Testing of doctests in the sources finished, look at the ^ results in %BUILDDIR%/doctest/output.txt. goto end ) if "%1" == "coverage" ( %SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage if errorlevel 1 exit /b 1 echo. echo.Testing of coverage in the sources finished, look at the ^ results in %BUILDDIR%/coverage/python.txt. goto end ) if "%1" == "xml" ( %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml if errorlevel 1 exit /b 1 echo. echo.Build finished. The XML files are in %BUILDDIR%/xml. goto end ) if "%1" == "pseudoxml" ( %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml if errorlevel 1 exit /b 1 echo. echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. goto end ) :end case-1.5.3+dfsg.orig/docs/images/0000755000175000017500000000000013053417144016032 5ustar mans0954mans0954case-1.5.3+dfsg.orig/docs/images/favicon.ico0000644000175000017500000001027613054235754020167 0ustar mans0954mans0954  ( @   O1w U4S3V4 V4 V4 V6 V6 W6 W6 W6 W7 W7 W7 W6 W6 W6 W6 V6 V4 V4 V4T4S3 S2O1w `:tFvHxJzKzL{M}N~O~OQRRR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GJ9B6ɪt[jp'qѸVV}G_p,3Ǒ5 'c}'C_`qH<ڼu\OP}z!q)Q#r 9@نS8KJ֞Kj찵퇡t;UkՌܓ BF{oGygSANyo*tl6ϯ&ra,*9e茮/jQOP4 #zιzvI^H숿5ҌhCVmY2r5s%Z( %T-ȍT,l_s=iHUA28•)WQ[o6Ds'GJEZ7 kL4R5OFRXac]&4.*vyS͛8r[_ >ݫ<цS!cU_udP1AF7&TBA4peaTf=~S4~+ KէirY҈v ai31ꋌHl+.}Ik[V6vL8K蜷;Tf b) lʔTR)zـ+7ÚRr8)Q#Z#m=-D2JUډܶ72jEFQ}"+"A3~;Yr[b:lB;[\#^_z2Ja,SUkCqcg-E7vMR$嘅!mB9rJ }6/ n 33~̫>Vv`"ш×NMmd4)\yQ욛w#4*QrdӬ55=y^'5hZV+C.?^Q{F6)אH (*bf6s*PȢB-9M[a-{ib:;_8>bqͿ!f/`͛7Vnqp1Ϗ~k*DowXI\m:})Sv tuD׿;VNfxO3S\Zþ| ?ZLO>ɗЕ7YGqa5tq N7x4'a c@qBU{՞:C_IFN47$9/^}^+gq=%M%7ryϥMY;̴Ëz!DH@w(B $ c~88׿9p7?<?!W5ևkAo_o}W|ɕϾu=~ߊ|W}PM=IENDB`case-1.5.3+dfsg.orig/docs/_templates/0000755000175000017500000000000013053417144016722 5ustar mans0954mans0954case-1.5.3+dfsg.orig/docs/_templates/sidebardonations.html0000644000175000017500000000601212736024711023140 0ustar mans0954mans0954 case-1.5.3+dfsg.orig/docs/templates/0000755000175000017500000000000013053417144016563 5ustar mans0954mans0954case-1.5.3+dfsg.orig/docs/templates/readme.txt0000644000175000017500000000232512755442606020574 0ustar mans0954mans0954===================================================================== Python unittest utilities ===================================================================== |build-status| |coverage| |license| |wheel| |pyversion| |pyimp| .. include:: ../includes/introduction.txt .. include:: ../includes/installation.txt .. |build-status| image:: https://secure.travis-ci.org/celery/case.png?branch=master :alt: Build status :target: https://travis-ci.org/celery/case .. |coverage| image:: https://codecov.io/github/celery/case/coverage.svg?branch=master :target: https://codecov.io/github/celery/case?branch=master .. |license| image:: https://img.shields.io/pypi/l/case.svg :alt: BSD License :target: https://opensource.org/licenses/BSD-3-Clause .. |wheel| image:: https://img.shields.io/pypi/wheel/case.svg :alt: Case can be installed via wheel :target: http://pypi.python.org/pypi/case/ .. |pyversion| image:: https://img.shields.io/pypi/pyversions/case.svg :alt: Supported Python versions. :target: http://pypi.python.org/pypi/case/ .. |pyimp| image:: https://img.shields.io/pypi/implementation/case.svg :alt: Support Python implementations. :target: http://pypi.python.org/pypi/case/ case-1.5.3+dfsg.orig/docs/conf.py0000644000175000017500000000130212736024711016061 0ustar mans0954mans0954# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals, print_function from sphinx_celery import conf globals().update(conf.build_config( 'case', __file__, project='Case', # version_dev='2.0', # version_stable='1.0', canonical_url='http://case.readthedocs.org', webdomain='celeryproject.org', github_project='celery/case', author='Ask Solem & contributors', author_name='Ask Solem', copyright='2016', publisher='Celery Project', html_logo='images/celery_128.png', html_favicon='images/favicon.ico', html_prepend_sidebars=['sidebardonations.html'], extra_extensions=[], include_intersphinx={'python', 'sphinx'}, )) case-1.5.3+dfsg.orig/docs/Makefile0000644000175000017500000001751112736024711016233 0ustar mans0954mans0954# Makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = sphinx-build PAPER = BUILDDIR = _build # User-friendly check for sphinx-build ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don\'t have Sphinx installed, grab it from http://sphinx-doc.org/) endif # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . .PHONY: help help: @echo "Please use \`make ' where is one of" @echo " html to make standalone HTML files" @echo " dirhtml to make HTML files named index.html in directories" @echo " singlehtml to make a single large HTML file" @echo " pickle to make pickle files" @echo " json to make JSON files" @echo " htmlhelp to make HTML files and a HTML help project" @echo " qthelp to make HTML files and a qthelp project" @echo " applehelp to make an Apple Help Book" @echo " devhelp to make HTML files and a Devhelp project" @echo " epub to make an epub" @echo " epub3 to make an epub3" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " latexpdf to make LaTeX files and run them through pdflatex" @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" @echo " text to make text files" @echo " man to make manual pages" @echo " texinfo to make Texinfo files" @echo " info to make Texinfo files and run them through makeinfo" @echo " gettext to make PO message catalogs" @echo " changes to make an overview of all changed/added/deprecated items" @echo " xml to make Docutils-native XML files" @echo " pseudoxml to make pseudoxml-XML files for display purposes" @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" @echo " coverage to run coverage check of the documentation (if enabled)" @echo " apicheck to verify that all modules are present in autodoc" .PHONY: clean clean: rm -rf $(BUILDDIR)/* .PHONY: html html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." .PHONY: dirhtml dirhtml: $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." .PHONY: singlehtml singlehtml: $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml @echo @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." .PHONY: pickle pickle: $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle @echo @echo "Build finished; now you can process the pickle files." .PHONY: json json: $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json @echo @echo "Build finished; now you can process the JSON files." .PHONY: htmlhelp htmlhelp: $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp @echo @echo "Build finished; now you can run HTML Help Workshop with the" \ ".hhp project file in $(BUILDDIR)/htmlhelp." .PHONY: qthelp qthelp: $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in $(BUILDDIR)/qthelp, like this:" @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/PROJ.qhcp" @echo "To view the help file:" @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/PROJ.qhc" .PHONY: applehelp applehelp: $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp @echo @echo "Build finished. The help book is in $(BUILDDIR)/applehelp." @echo "N.B. You won't be able to view it unless you put it in" \ "~/Library/Documentation/Help or install it in your application" \ "bundle." .PHONY: devhelp devhelp: $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp @echo @echo "Build finished." @echo "To view the help file:" @echo "# mkdir -p $$HOME/.local/share/devhelp/PROJ" @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/PROJ" @echo "# devhelp" .PHONY: epub epub: $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub @echo @echo "Build finished. The epub file is in $(BUILDDIR)/epub." .PHONY: epub3 epub3: $(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3 @echo @echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3." .PHONY: latex latex: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." @echo "Run \`make' in that directory to run these through (pdf)latex" \ "(use \`make latexpdf' here to do that automatically)." .PHONY: latexpdf latexpdf: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through pdflatex..." $(MAKE) -C $(BUILDDIR)/latex all-pdf @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." .PHONY: latexpdfja latexpdfja: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through platex and dvipdfmx..." $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." .PHONY: text text: $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text @echo @echo "Build finished. The text files are in $(BUILDDIR)/text." .PHONY: man man: $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man @echo @echo "Build finished. The manual pages are in $(BUILDDIR)/man." .PHONY: texinfo texinfo: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." @echo "Run \`make' in that directory to run these through makeinfo" \ "(use \`make info' here to do that automatically)." .PHONY: info info: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo "Running Texinfo files through makeinfo..." make -C $(BUILDDIR)/texinfo info @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." .PHONY: gettext gettext: $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale @echo @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." .PHONY: changes changes: $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes @echo @echo "The overview file is in $(BUILDDIR)/changes." .PHONY: linkcheck linkcheck: $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck @echo @echo "Link check complete; look for any errors in the above output " \ "or in $(BUILDDIR)/linkcheck/output.txt." .PHONY: doctest doctest: $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest @echo "Testing of doctests in the sources finished, look at the " \ "results in $(BUILDDIR)/doctest/output.txt." .PHONY: coverage coverage: $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage @echo "Testing of coverage in the sources finished, look at the " \ "results in $(BUILDDIR)/coverage/python.txt." .PHONY: apicheck apicheck: $(SPHINXBUILD) -b apicheck $(ALLSPHINXOPTS) $(BUILDDIR)/apicheck .PHONY: xml xml: $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml @echo @echo "Build finished. The XML files are in $(BUILDDIR)/xml." .PHONY: pseudoxml pseudoxml: $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml @echo @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." case-1.5.3+dfsg.orig/docs/changelog.rst0000644000175000017500000000003212736024711017242 0ustar mans0954mans0954.. include:: ../Changelog case-1.5.3+dfsg.orig/docs/includes/0000755000175000017500000000000013053417144016373 5ustar mans0954mans0954case-1.5.3+dfsg.orig/docs/includes/installation.txt0000644000175000017500000000170112736024711021635 0ustar mans0954mans0954.. _case-installation: Installation ============ You can install case either via the Python Package Index (PyPI) or from source. To install using `pip`,:: $ pip install -U case To install using `easy_install`,:: $ easy_install -U case .. _case-installing-from-source: Downloading and installing from source -------------------------------------- Download the latest version of case from http://pypi.python.org/pypi/case/ You can install it by doing the following,:: $ tar xvfz case-0.0.0.tar.gz $ cd case-0.0.0 $ python setup.py build # python setup.py install The last command must be executed as a privileged user if you are not currently using a virtualenv. .. _case-installing-from-git: Using the development version ----------------------------- With pip ~~~~~~~~ You can install the latest snapshot of case using the following pip command:: $ pip install https://github.com/celery/case/zipball/master#egg=case case-1.5.3+dfsg.orig/docs/includes/introduction.txt0000644000175000017500000000031213053417003021643 0ustar mans0954mans0954:Version: 1.5.3 :Web: http://case.readthedocs.org/ :Download: http://pypi.python.org/pypi/case/ :Source: http://github.com/celery/case/ :Keywords: testing utilities, python, unittest, mock About ===== case-1.5.3+dfsg.orig/docs/reference/0000755000175000017500000000000013053417144016523 5ustar mans0954mans0954case-1.5.3+dfsg.orig/docs/reference/case.utils.rst0000644000175000017500000000036312757166504021344 0ustar mans0954mans0954===================================================== ``case.utils`` ===================================================== .. contents:: :local: .. currentmodule:: case.utils .. automodule:: case.utils :members: :undoc-members: case-1.5.3+dfsg.orig/docs/reference/case.skip.rst0000644000175000017500000000036012757166466021156 0ustar mans0954mans0954===================================================== ``case.skip`` ===================================================== .. contents:: :local: .. currentmodule:: case.skip .. automodule:: case.skip :members: :undoc-members: case-1.5.3+dfsg.orig/docs/reference/case.mock.rst0000644000175000017500000000036012757166452021134 0ustar mans0954mans0954===================================================== ``case.mock`` ===================================================== .. contents:: :local: .. currentmodule:: case.mock .. automodule:: case.mock :members: :undoc-members: case-1.5.3+dfsg.orig/docs/reference/case.pytest.rst0000644000175000017500000000036612757166516021542 0ustar mans0954mans0954===================================================== ``case.pytest`` ===================================================== .. contents:: :local: .. currentmodule:: case.pytest .. automodule:: case.pytest :members: :undoc-members: case-1.5.3+dfsg.orig/docs/reference/case.rst0000644000175000017500000000034112757166457020210 0ustar mans0954mans0954===================================================== ``case`` ===================================================== .. contents:: :local: .. currentmodule:: case .. automodule:: case :members: :undoc-members: case-1.5.3+dfsg.orig/docs/reference/index.rst0000644000175000017500000000032212757166435020377 0ustar mans0954mans0954.. _apiref: =============== API Reference =============== :Release: |version| :Date: |today| .. toctree:: :maxdepth: 1 case case.case case.skip case.mock case.pytest case.utils case-1.5.3+dfsg.orig/docs/reference/case.case.rst0000644000175000017500000000040412757166444021116 0ustar mans0954mans0954===================================================== ``case.case`` ===================================================== .. contents:: :local: .. currentmodule:: case.case .. automodule:: case.case .. autoclass:: CaseMixin .. autoclass:: Case case-1.5.3+dfsg.orig/docs/_static/0000755000175000017500000000000013053417144016213 5ustar mans0954mans0954case-1.5.3+dfsg.orig/docs/_static/.keep0000644000175000017500000000000012736024711017127 0ustar mans0954mans0954case-1.5.3+dfsg.orig/docs/index.rst0000644000175000017500000000054212736024711016430 0ustar mans0954mans0954================================================== case - Python unittest Utilities ================================================== .. include:: includes/introduction.txt Contents ======== .. toctree:: :maxdepth: 2 reference/index changelog Indices and tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search` case-1.5.3+dfsg.orig/Changelog0000644000175000017500000001526713053417067015466 0ustar mans0954mans0954Changes ======= 1.5.3 ===== :release-date: 2017-02-22 03:26 p.m PST :release-by: Ask Solem - ``patch.multiple`` now works. 1.5.2 ===== :release-date: 2016-10-28 03:40 p.m. PDT :release-by: Ask Solem - Using setup/teardown instead of setup_method/teardown_method was a bad idea. Since it's way more common to override setup/teardown, and it's likely people forget to call super in these methods, the change crashed several test suites. So on pytest the decorators are now back to augmenting setup_method/teardown_method again. 1.5.1 ===== :release-date: 2016-10-28 03:40 p.m. PDT :release-by: Ask Solem - 1.5.0 had a left over print statement :blush: .. _version-1.5.0: 1.5.0 ===== :release-date: 2016-10-28 03:36 p.m. PDT :release-by: Ask Solem - Pytest: When decorating classes using the ``skip.*`` and ``mock.*`` decorators, these now augment ``cls.setup``/``cls.teardown`` instead of ``cls.setup_method``/``cls.teardown_method``. It's a bit hard to find in the pytest documentation, but pytest will always call test_cls.setup and test_cls.teardown. - Pytest: Adds ``patching.object``. This works exactly like :func:`unittest.mock.patch.object`, you give it an object and an attribute name, and it will patch that attribute on the object. It also supports the same arguments and extra options. Example: .. code-block:: python @pytest.fixture def channel(patching): c = Channel() patching(c, 'connect') return c .. _version-1.4.0: 1.4.0 ===== :release-date: 2016-10-17 06:14 p.m. PDT :release-by: Ask Solem - Adds new helper: ``case.pytest.fixture_with_options``. Example: .. code-block:: python @fixture_with_options() def sftp(request, username='test_username', password='test_password'): return {'username': username, 'password': password} @sftp.options(username='foo', password='bar') def test_foo(sftp): assert sftp['username'] == 'foo' assert sftp['password'] == 'bar' .. _version-1.3.1: 1.3.1 ===== :release-date: 2016-07-22 06:14 p.m. PDT :release-by: Ask Solem - All case decorators now works with py.test classes. - Py.test: Adds new `stdouts` fixture that patches :data:`sys.stdout`, and :data:`sys.stderr`. Example: .. code-block:: python def test_x(stdouts): print('foo') assert 'foo' in stdouts.stdout.getvalue() print('bar', file=sys.stderr) assert 'bar' in stdouts.stderr.getvalue() - Py.test: The `patching` fixture can now mock modules. Example: .. code-block:: python def test_x(patching): gevent, gevent_monkey = patching.modules( 'gevent', 'gevent.monkey', ) os = patching.modules('os') gevent_monkey.patch_all.side_effect = RuntimeError() with pytest.raises(RuntimeError): from gevent import monkey monkey.patch_all() .. _version-1.3.0: 1.3.0 ===== :release-date: 2016-07-18 05:33 p.m. PDT :release-by: Ask Solem - Case is now a py.test plug-in and provides a `patching` fixture as a shortcut to `monkeypatch` setting the value to a mock. This does not have any effects for users not using py.test. Example: .. code-block:: python def test_foo(patching): # execv value here will be mock.MagicMock by default. execv = patching('os.execv') patching('sys.platform', 'darwin') # set concrete value patching.setenv('DJANGO_SETTINGS_MODULE', 'x.settings') # val will be of type mock.MagicMock by default val = patching.setitem('path.to.dict', 'KEY') .. _version-1.2.3: 1.2.3 ===== :release-date: 2016-06-15 03:00 p.m. PDT :release-by: Ask Solem - Case decorators now supports py.test. - Patcher created by create_patcher now accepts *args. .. _version-1.2.2: 1.2.2 ===== :release-date: 2016-06-23 02:46 p.m. PDT :release-by: Ask Solem - ``mock.reload_modules``: Fixed compatibility with Python 3. .. _version-1.2.1: 1.2.1 ===== :release-date: 2016-06-23 12:111 p.m. PDT :release-by: Ask Solem - ``mock.reload_modules`` now re-imports the module and calls ``reload()`` on it. This fixes issues with side effects not being properly reset after context exits. .. _version-1.2.0: 1.2.0 ===== :release-date: 2016-06-13 05:00 p.m. PDT :release-by: Ask Solem - Adds ``mock.mute`` decorator to suppress stdout with no return value. Contributed by Tony Narlock. - Adds ``Mock.on_nth_call_do_raise(excA, excB, n)``. This will make the mock raise excA until called n times, in which it will start to raise excB. .. _version-1.1.4: 1.1.4 ===== :release-date: 2016-05-12 03:04 p.m. PDT :release-by: Ask Solem - ``case.patch.*`` functions now supports using ``new`` as a positional argument, for compatibility with ``mock.patch``. .. _version-1.1.3: 1.1.3 ===== :release-date: 2016-04-19 04:41 p.m. PDT :release-by: Ask Solem - ``case.patch(autospec=True)`` now works. This will use the original mock.MagicMock, not case.MagicMock. .. _version-1.1.2: 1.1.2 ===== :release-date: 2016-04-08 11:34 p.m. PDT :release-by: Ask Solem - Also :func:`case.patch.multiple`, and :func:`case.patch.object` now gives :class:`case.MagicMock`. .. _version-1.1.1: 1.1.1 ===== :release-date: 2016-04-08 11:13 p.m. PDT :release-by: Ask Solem - :func:`case.patch` now gives :class:`case.MagicMock` (not ``mock.MagicMock``). .. _version-1.1.0: 1.1.0 ===== :release-date: 2016-04-08 10:00 p.m. PDT :release-by: Ask Solem - Adds new Mock methods from Python 3.6: - ``Mock.assert_called()`` - ``Mock.assert_not_called()`` - ``Mock.assert_called_once()`` - Adds ``Mock.create_patcher()`` Example: .. code-block:: python from case import Case, mock patch_commands = mock.create_patcher('long_name.management.commands') class test_FooCommand(Case): @patch_commands('FooCommand.authenticate') def test_foo(self, authenticate): pass .. _version-1.0.3: 1.0.3 ===== :release-date: 2016-04-06 04:00 p.m. PDT :release-by: Ask Solem - Python 2.6 compatibility. - ``mock.platform_pyimp`` no longer accepted default value. .. _version-1.0.2: 1.0.2 ===== :release-date: 2016-04-06 03:46 p.m. PDT :release-by: Ask Solem - Adds docstrings .. _version-1.0.1: 1.0.1 ===== :release-date: 2016-04-05 04:00 p.m. PDT :release-by: Ask Solem - Fixed issues with Python 3 .. _version-1.0.0: 1.0.0 ===== :release-date: 2016-04-05 02:00 p.m. PDT :release-by: Ask Solem - Initial release case-1.5.3+dfsg.orig/README.rst0000644000175000017500000000441513053417003015322 0ustar mans0954mans0954===================================================================== Python unittest utilities ===================================================================== |build-status| |coverage| |license| |wheel| |pyversion| |pyimp| :Version: 1.5.3 :Web: http://case.readthedocs.org/ :Download: http://pypi.python.org/pypi/case/ :Source: http://github.com/celery/case/ :Keywords: testing utilities, python, unittest, mock About ===== .. _case-installation: Installation ============ You can install case either via the Python Package Index (PyPI) or from source. To install using `pip`,:: $ pip install -U case To install using `easy_install`,:: $ easy_install -U case .. _case-installing-from-source: Downloading and installing from source -------------------------------------- Download the latest version of case from http://pypi.python.org/pypi/case/ You can install it by doing the following,:: $ tar xvfz case-0.0.0.tar.gz $ cd case-0.0.0 $ python setup.py build # python setup.py install The last command must be executed as a privileged user if you are not currently using a virtualenv. .. _case-installing-from-git: Using the development version ----------------------------- With pip ~~~~~~~~ You can install the latest snapshot of case using the following pip command:: $ pip install https://github.com/celery/case/zipball/master#egg=case .. |build-status| image:: https://secure.travis-ci.org/celery/case.png?branch=master :alt: Build status :target: https://travis-ci.org/celery/case .. |coverage| image:: https://codecov.io/github/celery/case/coverage.svg?branch=master :target: https://codecov.io/github/celery/case?branch=master .. |license| image:: https://img.shields.io/pypi/l/case.svg :alt: BSD License :target: https://opensource.org/licenses/BSD-3-Clause .. |wheel| image:: https://img.shields.io/pypi/wheel/case.svg :alt: Case can be installed via wheel :target: http://pypi.python.org/pypi/case/ .. |pyversion| image:: https://img.shields.io/pypi/pyversions/case.svg :alt: Supported Python versions. :target: http://pypi.python.org/pypi/case/ .. |pyimp| image:: https://img.shields.io/pypi/implementation/case.svg :alt: Support Python implementations. :target: http://pypi.python.org/pypi/case/