Skip to content

Commit 565dd0e

Browse files
committed
Initial import
0 parents  commit 565dd0e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+3016
-0
lines changed

.coveragerc

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[run]
2+
branch = 1
3+
cover_pylib = 0
4+
include=*case/*
5+
omit = case.tests.*
6+
7+
[report]
8+
omit =
9+
*/python?.?/*
10+
*/site-packages/*
11+
*/pypy/*

.gitignore

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
.DS_Store
2+
*.pyc
3+
*$py.class
4+
*~
5+
.*.sw[pon]
6+
dist/
7+
*.egg-info
8+
*.egg
9+
*.egg/
10+
doc/__build/*
11+
build/
12+
.build/
13+
pip-log.txt
14+
.directory
15+
erl_crash.dump
16+
*.db
17+
Documentation/
18+
.tox/
19+
.ropeproject/
20+
.project
21+
.pydevproject
22+
.idea/
23+
.coverage
24+
celery/tests/cover/
25+
.ve*
26+
cover/
27+
.vagrant/
28+
*.sqlite3

.travis.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
language: python
2+
sudo: false
3+
cache: false
4+
python:
5+
- '3.5'
6+
env:
7+
global:
8+
PYTHONUNBUFFERED=yes
9+
matrix:
10+
- TOXENV=2.6
11+
- TOXENV=2.7
12+
- TOXENV=3.3
13+
- TOXENV=3.4
14+
- TOXENV=3.4
15+
- TOXENV=pypy
16+
- TOXENV=3.5
17+
- TOXENV=pypy3
18+
install: travis_retry pip install -U tox
19+
script: tox -v -- -v
20+
after_success:
21+
- .tox/$TRAVIS_PYTHON_VERSION/bin/coverage xml
22+
- .tox/$TRAVIS_PYTHON_VERSION/bin/codecov -e TOXENV

AUTHORS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Ask Solem <[email protected]>

Changelog

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Changes
2+
=======
3+
4+
.. _version-1.0.0:
5+
6+
1.0.0
7+
=====
8+
:release-date: TBA
9+
:release-by:

LICENSE

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
Copyright (c) 2012-2016 Ask Solem & contributors. All rights reserved.
2+
3+
CASE is licensed under The BSD License (3 Clause, also known as
4+
the new BSD license). The license is an OSI approved Open Source
5+
license and is GPL-compatible(1).
6+
7+
The license text can also be found here:
8+
http://www.opensource.org/licenses/BSD-3-Clause
9+
10+
License
11+
=======
12+
13+
Redistribution and use in source and binary forms, with or without
14+
modification, are permitted provided that the following conditions are met:
15+
* Redistributions of source code must retain the above copyright
16+
notice, this list of conditions and the following disclaimer.
17+
* Redistributions in binary form must reproduce the above copyright
18+
notice, this list of conditions and the following disclaimer in the
19+
documentation and/or other materials provided with the distribution.
20+
* Neither the name of Ask Solem, nor the
21+
names of its contributors may be used to endorse or promote products
22+
derived from this software without specific prior written permission.
23+
24+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
26+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
27+
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Ask Solem OR CONTRIBUTORS
28+
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34+
POSSIBILITY OF SUCH DAMAGE.
35+
36+
Documentation License
37+
=====================
38+
39+
The documentation portion of CASE (the rendered contents of the
40+
"docs" directory of a software distribution or checkout) is supplied
41+
under the "Creative Commons Attribution-ShareAlike 4.0
42+
International" (CC BY-SA 4.0) License as described by
43+
http://creativecommons.org/licenses/by-sa/4.0/
44+
45+
Footnotes
46+
=========
47+
(1) A GPL-compatible license makes it possible to
48+
combine CASE with other software that is released
49+
under the GPL, it does not mean that we're distributing
50+
CASE under the GPL license. The BSD license, unlike the GPL,
51+
let you distribute a modified version without making your
52+
changes open source.

MANIFEST.in

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
include README.rst Changelog LICENSE
2+
recursive-include docs *
3+
recursive-include extra README *.py
4+
recursive-include requirements *.txt

Makefile

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
PYTHON=python
2+
SPHINX_DIR="docs/"
3+
SPHINX_BUILDDIR="${SPHINX_DIR}/.build"
4+
README="README.rst"
5+
README_SRC="docs/templates/readme.txt"
6+
CONTRIBUTING_SRC="docs/contributing.rst"
7+
SPHINX2RST="extra/release/sphinx-to-rst.py"
8+
9+
SPHINX_HTMLDIR = "${SPHINX_BUILDDIR}/html"
10+
11+
html:
12+
(cd "$(SPHINX_DIR)"; make html)
13+
mv "$(SPHINX_HTMLDIR)" Documentation
14+
15+
docsclean:
16+
-rm -rf "$(SPHINX_BUILDDIR)"
17+
18+
htmlclean:
19+
-rm -rf "$(SPHINX)"
20+
21+
apicheck:
22+
extra/release/doc4allmods case
23+
24+
indexcheck:
25+
extra/release/verify-reference-index.sh
26+
27+
flakecheck:
28+
flake8 case
29+
30+
flakediag:
31+
-$(MAKE) flakecheck
32+
33+
flakepluscheck:
34+
flakeplus case --2.7
35+
36+
flakeplusdiag:
37+
-$(MAKE) flakepluscheck
38+
39+
flakes: flakediag flakeplusdiag
40+
41+
readmeclean:
42+
-rm -f $(README)
43+
44+
readmecheck:
45+
iconv -f ascii -t ascii $(README) >/dev/null
46+
47+
$(README):
48+
$(PYTHON) $(SPHINX2RST) $(README_SRC) --ascii > $@
49+
50+
readme: readmeclean $(README) readmecheck
51+
52+
test:
53+
(cd testproj; python manage.py test -x)
54+
55+
cov:
56+
(cd testproj; python manage.py -x --with-coverage --cover-html --cover-branch)
57+
58+
removepyc:
59+
-find . -type f -a \( -name "*.pyc" -o -name "*$$py.class" \) | xargs rm
60+
-find . -type d -name "__pycache__" | xargs rm -r
61+
62+
gitclean: removepyc
63+
git clean -xdn
64+
65+
gitcleanforce:
66+
git clean -xdf
67+
68+
bump_version:
69+
$(PYTHON) extra/release/bump_version.py case/__init__.py README.rst
70+
71+
distcheck: flakecheck apicheck indexcheck readmecheck test gitclean
72+
73+
dist: readme docsclean gitcleanforce removepyc

README.rst

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
=====================================================================
2+
Python unittest utilities
3+
=====================================================================
4+
5+
:Version: 1.0.0
6+
:Web: http://case.readthedocs.org/
7+
:Download: http://pypi.python.org/pypi/case/
8+
:Source: http://github.com/celery/case/
9+
:Keywords: testing utilities, python, unittest, mock
10+
11+
About
12+
=====
13+
14+
.. _case-installation:
15+
16+
Installation
17+
============
18+
19+
You can install case either via the Python Package Index (PyPI)
20+
or from source.
21+
22+
To install using `pip`,::
23+
24+
$ pip install -U case
25+
26+
To install using `easy_install`,::
27+
28+
$ easy_install -U case
29+
30+
.. _case-installing-from-source:
31+
32+
Downloading and installing from source
33+
--------------------------------------
34+
35+
Download the latest version of case from
36+
http://pypi.python.org/pypi/case/
37+
38+
You can install it by doing the following,::
39+
40+
$ tar xvfz case-0.0.0.tar.gz
41+
$ cd case-0.0.0
42+
$ python setup.py build
43+
# python setup.py install
44+
45+
The last command must be executed as a privileged user if
46+
you are not currently using a virtualenv.
47+
48+
.. _case-installing-from-git:
49+
50+
Using the development version
51+
-----------------------------
52+
53+
With pip
54+
~~~~~~~~
55+
56+
You can install the latest snapshot of case using the following
57+
pip command::
58+
59+
$ pip install https://github.com/celery/case/zipball/master#egg=case
60+

appveyor.yml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
environment:
2+
3+
global:
4+
# SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
5+
# /E:ON and /V:ON options are not enabled in the batch script intepreter
6+
# See: http://stackoverflow.com/a/13751649/163740
7+
WITH_COMPILER: "cmd /E:ON /V:ON /C .\\extra\\appveyor\\run_with_compiler.cmd"
8+
9+
matrix:
10+
11+
# Pre-installed Python versions, which Appveyor may upgrade to
12+
# a later point release.
13+
# See: http://www.appveyor.com/docs/installed-software#python
14+
15+
- PYTHON: "C:\\Python27"
16+
PYTHON_VERSION: "2.7.x"
17+
PYTHON_ARCH: "32"
18+
19+
- PYTHON: "C:\\Python34"
20+
PYTHON_VERSION: "3.4.x"
21+
PYTHON_ARCH: "32"
22+
23+
- PYTHON: "C:\\Python27-x64"
24+
PYTHON_VERSION: "2.7.x"
25+
PYTHON_ARCH: "64"
26+
WINDOWS_SDK_VERSION: "v7.0"
27+
28+
- PYTHON: "C:\\Python34-x64"
29+
PYTHON_VERSION: "3.4.x"
30+
PYTHON_ARCH: "64"
31+
WINDOWS_SDK_VERSION: "v7.1"
32+
33+
34+
init:
35+
- "ECHO %PYTHON% %PYTHON_VERSION% %PYTHON_ARCH%"
36+
37+
install:
38+
- "powershell extra\\appveyor\\install.ps1"
39+
- "%PYTHON%/Scripts/pip.exe install -U setuptools"
40+
41+
build: off
42+
43+
test_script:
44+
- "%WITH_COMPILER% %PYTHON%/python setup.py test"
45+
46+
after_test:
47+
- "%WITH_COMPILER% %PYTHON%/python setup.py bdist_wheel"
48+
49+
artifacts:
50+
- path: dist\*
51+
52+
#on_success:
53+
# - TODO: upload the content of dist/*.whl to a public wheelhouse

case/__init__.py

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
"""Python unittest Utilities"""
2+
from __future__ import absolute_import, unicode_literals
3+
4+
from .case import Case
5+
from .mock import ANY, ContextMock, MagicMock, Mock, call, patch, sentinel
6+
7+
from . import mock
8+
from . import skip
9+
10+
VERSION = (1, 0, 0)
11+
__version__ = '.'.join(map(str, VERSION[0:3])) + ''.join(VERSION[3:])
12+
__author__ = 'Ask Solem'
13+
__contact__ = '[email protected]'
14+
__homepage__ = 'http://github.com/celery/case'
15+
__docformat__ = 'restructuredtext'
16+
17+
# -eof meta-
18+
19+
__all__ = [
20+
b'Case',
21+
22+
b'ANY', b'ContextMock', b'MagicMock', b'Mock',
23+
b'call', b'patch', b'sentinel',
24+
25+
b'mock', b'skip',
26+
]

0 commit comments

Comments
 (0)