[Python-modules-commits] [systemfixtures] 01/04: New upstream version 0.4.0

Free Ekanayaka freee at moszumanska.debian.org
Mon Oct 31 13:59:32 UTC 2016


This is an automated email from the git hooks/post-receive script.

freee pushed a commit to branch master
in repository systemfixtures.

commit 58c57beebfcf06226a31d8ca0bc75d660973fb6b
Author: Free Ekanayaka <freee at debian.org>
Date:   Fri Oct 28 16:39:19 2016 +0000

    New upstream version 0.4.0
---
 .coveragerc.py27                                 |   4 +
 .coveragerc.py35                                 |   4 +
 .testr.conf                                      |   4 +
 .travis.yml                                      |  29 +++
 AUTHORS                                          |   1 +
 ChangeLog                                        |   7 +
 LICENSE                                          |  20 ++
 PKG-INFO                                         |  55 ++++
 README.rst                                       |  41 +++
 docs/Makefile                                    | 216 ++++++++++++++++
 docs/_static/.placeholder                        |   0
 docs/conf.py                                     | 316 +++++++++++++++++++++++
 docs/index.rst                                   | 313 ++++++++++++++++++++++
 requirements.txt                                 |   6 +
 setup.cfg                                        |  39 +++
 setup.py                                         |   6 +
 systemfixtures.egg-info/PKG-INFO                 |  55 ++++
 systemfixtures.egg-info/SOURCES.txt              |  48 ++++
 systemfixtures.egg-info/dependency_links.txt     |   1 +
 systemfixtures.egg-info/not-zip-safe             |   1 +
 systemfixtures.egg-info/pbr.json                 |   1 +
 systemfixtures.egg-info/requires.txt             |  11 +
 systemfixtures.egg-info/top_level.txt            |   1 +
 systemfixtures/__init__.py                       |  32 +++
 systemfixtures/_overlay.py                       |  26 ++
 systemfixtures/filesystem.py                     | 142 ++++++++++
 systemfixtures/groups.py                         |  21 ++
 systemfixtures/matchers.py                       |  15 ++
 systemfixtures/network.py                        |  15 ++
 systemfixtures/processes/__init__.py             |  12 +
 systemfixtures/processes/dpkg.py                 |  24 ++
 systemfixtures/processes/fixture.py              |  55 ++++
 systemfixtures/processes/systemctl.py            |  24 ++
 systemfixtures/processes/tests/__init__.py       |   0
 systemfixtures/processes/tests/test_dpkg.py      |  14 +
 systemfixtures/processes/tests/test_fixture.py   |  25 ++
 systemfixtures/processes/tests/test_systemctl.py |  27 ++
 systemfixtures/processes/tests/test_wget.py      |  24 ++
 systemfixtures/processes/wget.py                 |  26 ++
 systemfixtures/tests/__init__.py                 |   0
 systemfixtures/tests/test_filesystem.py          | 116 +++++++++
 systemfixtures/tests/test_groups.py              |  21 ++
 systemfixtures/tests/test_network.py             |  17 ++
 systemfixtures/tests/test_time.py                |  23 ++
 systemfixtures/tests/test_users.py               |  21 ++
 systemfixtures/time.py                           |  14 +
 systemfixtures/users.py                          |  22 ++
 test                                             |  14 +
 tox.ini                                          |  37 +++
 49 files changed, 1946 insertions(+)

diff --git a/.coveragerc.py27 b/.coveragerc.py27
new file mode 100644
index 0000000..5cdeb73
--- /dev/null
+++ b/.coveragerc.py27
@@ -0,0 +1,4 @@
+[report]
+exclude_lines =
+    # pragma: no cover
+    if six.PY3:
diff --git a/.coveragerc.py35 b/.coveragerc.py35
new file mode 100644
index 0000000..9fabaaa
--- /dev/null
+++ b/.coveragerc.py35
@@ -0,0 +1,4 @@
+[report]
+exclude_lines =
+    # pragma: no cover
+    if six.PY2:
diff --git a/.testr.conf b/.testr.conf
new file mode 100644
index 0000000..aa88c6a
--- /dev/null
+++ b/.testr.conf
@@ -0,0 +1,4 @@
+[DEFAULT]
+test_command=./test $LISTOPT $IDOPTION
+test_id_option=--load-list $IDFILE
+test_list_option=--list
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..af64fb4
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,29 @@
+sudo: false
+language: python
+
+python:
+  - "2.7"
+  - '3.5'
+
+install:
+  - pip install tox-travis
+  - pip install python-coveralls
+
+script:
+  - tox
+
+after_success:
+  - coveralls
+
+deploy:
+  provider: pypi
+  user: free.ekanayaka
+  password:
+    secure: C1fH6R8Zql0/TcqNihRkO81pt7iNCTAafOtHWId6xi1eS34ymVoqh2GuqsAaJTk+xlIp2bePJR98M8bj5OwBbHilWpBYeTy10T5vVUcao4trbqaylL7nXMbJWl4I011reWkM3fISYX2mhevhf0g3KRMckEkCCcsTKIl2qrzwm1YTuHJBvfzJzVWj7ZeNVyawwRKRfs2KTH25JS4uf6Q4mYGS0nrs04VlHdtqwx0NqjOGgbYTylvl6omBtyJ8Z7VIDPl7whj+HCb0wAOUGvCLiTvSqZUpIlEeo6qF299xf8P7pXmo+29M6Moe03GNtFdBoskesezmwf5oT7CiSzTEjbOrVfHCqcD/00SRs2qH2ex8uJcb3vcj+i4qOMnhhcLCKTY7sFYeRoabwDp28SqY4FtEN+4mveUUdtO246hWC9n99wNJTODdfJG/TPmJ58h5HWepP8muG8Zqv94B177rSfkx4BlSCOY6 [...]
+  docs_dir: .tox/docs35/tmp/doctest
+  upload_docs: true
+  on:
+    tags: true
+    condition: $TRAVIS_PYTHON_VERSION = "3.5"
+    distributions: "sdist bdist_wheel"
+    repo: freeekanayaka/systemfixtures
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..a801eff
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1 @@
+Free Ekanayaka <free at ekanayaka.io>
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..de2249a
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,7 @@
+CHANGES
+=======
+
+0.4.0
+-----
+
+* Initial release
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..3a91400
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2016 Free Ekanayaka
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/PKG-INFO b/PKG-INFO
new file mode 100644
index 0000000..0535688
--- /dev/null
+++ b/PKG-INFO
@@ -0,0 +1,55 @@
+Metadata-Version: 1.1
+Name: systemfixtures
+Version: 0.4.0
+Summary: Test fixtures for providing fake versions of various system resources (processes, users, groups, etc.)
+Home-page: https://github.com/freeekanayaka/systemfixtures
+Author: Free Ekanayaka
+Author-email: free at ekanayaka.io
+License: MIT
+Description: =====================================================
+        Test fixtures for faking out various system resources
+        =====================================================
+        
+        .. image:: https://img.shields.io/pypi/v/systemfixtures.svg
+            :target: https://pypi.python.org/pypi/systemfixtures
+            :alt: Latest Version
+        
+        .. image:: https://travis-ci.org/freeekanayaka/systemfixtures.svg?branch=master
+            :target: https://travis-ci.org/freeekanayaka/systemfixtures
+            :alt: Build Status
+        
+        .. image:: https://coveralls.io/repos/github/freeekanayaka/charm-test/badge.svg?branch=master
+            :target: https://coveralls.io/github/freeekanayaka/charm-test?branch=master
+            :alt: Coverage
+        
+        Example
+        -------
+        
+        Please see the `full documentation <http://pythonhosted.org/systemfixtures/>`_ for
+        more information.
+        
+        .. code:: python
+        
+           >>> import pwd
+        
+           >>> from systemfixtures import FakeUsers
+        
+           >>> users = FakeUsers()
+           >>> users.setUp()
+        
+           >>> pwd.getpwnam("foo")
+           Traceback (most recent call last):
+           ...
+           KeyError: 'getpwnam(): name not found: foo'
+        
+           >>> users.add("foo", 123)
+           >>> info = pwd.getpwnam("foo")
+           >>> info.pw_uid
+           123
+           >>> users.cleanUp()
+        
+        
+Platform: POSIX
+Classifier: License :: OSI Approved :: MIT License
+Classifier: Operating System :: POSIX
+Classifier: Programming Language :: Python :: 3
diff --git a/README.rst b/README.rst
new file mode 100644
index 0000000..3932a40
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,41 @@
+=====================================================
+Test fixtures for faking out various system resources
+=====================================================
+
+.. image:: https://img.shields.io/pypi/v/systemfixtures.svg
+    :target: https://pypi.python.org/pypi/systemfixtures
+    :alt: Latest Version
+
+.. image:: https://travis-ci.org/freeekanayaka/systemfixtures.svg?branch=master
+    :target: https://travis-ci.org/freeekanayaka/systemfixtures
+    :alt: Build Status
+
+.. image:: https://coveralls.io/repos/github/freeekanayaka/charm-test/badge.svg?branch=master
+    :target: https://coveralls.io/github/freeekanayaka/charm-test?branch=master
+    :alt: Coverage
+
+Example
+-------
+
+Please see the `full documentation <http://pythonhosted.org/systemfixtures/>`_ for
+more information.
+
+.. code:: python
+
+   >>> import pwd
+
+   >>> from systemfixtures import FakeUsers
+
+   >>> users = FakeUsers()
+   >>> users.setUp()
+
+   >>> pwd.getpwnam("foo")
+   Traceback (most recent call last):
+   ...
+   KeyError: 'getpwnam(): name not found: foo'
+
+   >>> users.add("foo", 123)
+   >>> info = pwd.getpwnam("foo")
+   >>> info.pw_uid
+   123
+   >>> users.cleanUp()
diff --git a/docs/Makefile b/docs/Makefile
new file mode 100644
index 0000000..aa62dd4
--- /dev/null
+++ b/docs/Makefile
@@ -0,0 +1,216 @@
+# 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 <target>' where <target> 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 "  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)"
+
+.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/systemfixtures.qhcp"
+	@echo "To view the help file:"
+	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/systemfixtures.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/systemfixtures"
+	@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/systemfixtures"
+	@echo "# devhelp"
+
+.PHONY: epub
+epub:
+	$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+	@echo
+	@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
+
+.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: 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."
diff --git a/docs/_static/.placeholder b/docs/_static/.placeholder
new file mode 100644
index 0000000..e69de29
diff --git a/docs/conf.py b/docs/conf.py
new file mode 100644
index 0000000..e18b433
--- /dev/null
+++ b/docs/conf.py
@@ -0,0 +1,316 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+#
+# systemfixtures documentation build configuration file, created by
+# sphinx-quickstart on Thu Oct 27 06:54:09 2016.
+#
+# This file is execfile()d with the current directory set to its
+# containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys
+import os
+import re
+import doctest
+
+import six
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+sys.path.insert(0, os.path.abspath('..'))
+
+# -- General configuration ------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be
+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
+# ones.
+extensions = [
+    'sphinx.ext.doctest',
+    'sphinx.ext.coverage',
+]
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix(es) of source filenames.
+# You can specify multiple suffix as a list of string:
+# source_suffix = ['.rst', '.md']
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8-sig'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = 'systemfixtures'
+copyright = '2016, Free Ekanayaka'
+author = 'Free Ekanayaka'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = '0.3.5'
+# The full version, including alpha/beta/rc tags.
+release = '0.3.5'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#
+# This is also used if you do content translation via gettext catalogs.
+# Usually you set "language" from the command line for these cases.
+language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = ['_build']
+
+# The reST default role (used for this markup: `text`) to use for all
+# documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+# If true, keep warnings as "system message" paragraphs in the built documents.
+#keep_warnings = False
+
+# If true, `todo` and `todoList` produce output, else they produce nothing.
+todo_include_todos = False
+
+
+# -- Options for HTML output ----------------------------------------------
+
+# The theme to use for HTML and HTML Help pages.  See the documentation for
+# a list of builtin themes.
+html_theme = 'alabaster'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further.  For a list of options available for each theme, see the
+# documentation.
+#html_theme_options = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+#html_theme_path = []
+
+# The name for this set of Sphinx documents.  If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# A shorter title for the navigation bar.  Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# The name of an image file (relative to this directory) to use as a favicon of
+# the docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
+
+# Add any extra paths that contain custom files (such as robots.txt or
+# .htaccess) here, relative to this directory. These files are copied
+# directly to the root of the documentation.
+#html_extra_path = []
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_domain_indices = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+#html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+#html_show_copyright = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it.  The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = None
+
+# Language to be used for generating the HTML full-text search index.
+# Sphinx supports the following languages:
+#   'da', 'de', 'en', 'es', 'fi', 'fr', 'h', 'it', 'ja'
+#   'nl', 'no', 'pt', 'ro', 'r', 'sv', 'tr'
+#html_search_language = 'en'
+
+# A dictionary with options for the search language support, empty by default.
+# Now only 'ja' uses this config value
+#html_search_options = {'type': 'default'}
+
+# The name of a javascript file (relative to the configuration directory) that
+# implements a search results scorer. If empty, the default will be used.
+#html_search_scorer = 'scorer.js'
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'systemfixturesdoc'
+
+# -- Options for LaTeX output ---------------------------------------------
+
+latex_elements = {
+# The paper size ('letterpaper' or 'a4paper').
+#'papersize': 'letterpaper',
+
+# The font size ('10pt', '11pt' or '12pt').
+#'pointsize': '10pt',
+
+# Additional stuff for the LaTeX preamble.
+#'preamble': '',
+
+# Latex figure (float) alignment
+#'figure_align': 'htbp',
+}
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title,
+#  author, documentclass [howto, manual, or own class]).
+latex_documents = [
+    (master_doc, 'systemfixtures.tex', 'systemfixtures Documentation',
+     'Free Ekanayaka', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# If true, show page references after internal links.
+#latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+#latex_show_urls = False
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_domain_indices = True
+
+
+# -- Options for manual page output ---------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+    (master_doc, 'systemfixtures', 'systemfixtures Documentation',
+     [author], 1)
+]
+
+# If true, show URL addresses after external links.
+#man_show_urls = False
+
+
+# -- Options for Texinfo output -------------------------------------------
+
+# Grouping the document tree into Texinfo files. List of tuples
+# (source start file, target name, title, author,
+#  dir menu entry, description, category)
+texinfo_documents = [
+    (master_doc, 'systemfixtures', 'systemfixtures Documentation',
+     author, 'systemfixtures', 'One line description of project.',
+     'Miscellaneous'),
+]
+
+# Documents to append as an appendix to all manuals.
+#texinfo_appendices = []
+
+# If false, no module index is generated.
+#texinfo_domain_indices = True
+
+# How to display URL addresses: 'footnote', 'no', or 'inline'.
+#texinfo_show_urls = 'footnote'
+
+# If true, do not generate a @detailmenu in the "Top" node's menu.
+#texinfo_no_detailmenu = False
+
+
+OutputChecker = doctest.OutputChecker
+
+
+class SixOutputChecker(OutputChecker):
+    """Output checker compatible with both Python 2 and 3. See:
+    https://dirkjan.ochtman.nl/writing/2014/07/06/single-source-python-23-doctests.html
+    """
+
+    def check_output(self, want, got, optionflags):
+        if six.PY2:
+            if want == "12\n":  # write() doesn't return number of bytes on PY2
+                want = ""
+
+            want = re.sub("PermissionError: (.*)", "OSError: \\1", want)
+            want = re.sub("'0o(.+)'\n", "'0\\1'\n", want)
+            want = re.sub("b'(.*?)'", "'\\1'", want)
+
+            got = re.sub("u'(.*?)'", "'\\1'", got)
+
+        return OutputChecker.check_output(self, want, got, optionflags)
+
+
+doctest.OutputChecker = SixOutputChecker
diff --git a/docs/index.rst b/docs/index.rst
new file mode 100644
index 0000000..83ff788
--- /dev/null
+++ b/docs/index.rst
@@ -0,0 +1,313 @@
+.. systemfixtures documentation master file, created by
+   sphinx-quickstart on Thu Oct 27 06:54:09 2016.
+   You can adapt this file completely to your liking, but it should at least
+   contain the root `toctree` directive.
+
+Welcome to systemfixtures's documentation!
+==========================================
+
+Overview
+--------
+
+A collection of Python fixtures_ to fake out  various system resources (processes,
+users, groups, etc.).
+
+.. _fixtures: https://github.com/testing-cabal/fixtures
+
+Each fake resource typically behaves as an "overlay" on the real resource, in
+that it can be programmed with fake behavior for a set of inputs, but falls
+back to the real behavior for the rest. See the examples below for more
+information.
+
+The implementation is mostly built upon the basic MonkeyPatch_ fixture.
+
+.. _MonkeyPatch: https://github.com/testing-cabal/fixtures/blob/master/fixtures/_fixtures/monkeypatch.py
+
+
+Examples
+--------
+
+Users
++++++
+
+The :class:`FakeUsers` fixture lets you add fake system users, that do not
+exist for real, but behave the same as real ones:
+
+.. doctest::
+
+   >>> import pwd
+
+   >>> from systemfixtures import FakeUsers
+
+   >>> users = FakeUsers()
+   >>> users.setUp()
+
+   >>> pwd.getpwnam("foo")
+   Traceback (most recent call last):
+   ...
+   KeyError: 'getpwnam(): name not found: foo'
+
+   >>> users.add("foo", 123)
+   >>> info = pwd.getpwnam("foo")
+   >>> info.pw_uid
+   123
+   >>> users.cleanUp()
+
+Groups
+++++++
+
+The :class:`FakeGroups` fixture lets you add fake system groups, that do not
+exist for real, but behave the same as real ones:
+
+.. doctest::
+
+   >>> import grp
+
+   >>> from systemfixtures import FakeGroups
+
+   >>> groups = FakeGroups()
+   >>> groups.setUp()
+
+   >>> grp.getgrnam("foo")
+   Traceback (most recent call last):
+   ...
+   KeyError: 'getgrnam(): name not found: foo'
+
+   >>> groups.add("foo", 123)
+   >>> info = grp.getgrnam("foo")
+   >>> info.gr_gid
+   123
+
+   >>> groups.cleanUp()
+
+Filesystem
+++++++++++
+
+The :class:`FakeFilesystem` fixture lets you add a temporary directory as
+filesystem "overlay". You can declare certain paths as belonging
+to the overlay, and filesystem APIs like :func:`open`, :func:`os.mkdir`,
+:func:`os.chown`, :func:`os.chmod` and :func:`os.stat` will be transparently
+redirected to act on the temporary directory instead of the real filesystem
+path:
+
+.. doctest::
+
+   >>> import os
+   >>> import tempfile
+
+   >>> from systemfixtures import FakeFilesystem
+
+   >>> filesystem = FakeFilesystem()
+   >>> filesystem.setUp()
+
+Trying to create a directory under the root one will fail, since we are
+running as unprivileged user:
+
+.. doctest::
+
+   >>> os.mkdir("/foo")
+   Traceback (most recent call last):
+   ...
+   PermissionError: [Errno 13] Permission denied: '/foo'
+
+However, if we add the directory path to the fake filesystem, it will be
+possible to create it as overlay directory:
+
+.. doctest::
+
+   >>> filesystem.add("/foo")
+   >>> os.mkdir("/foo")
+   >>> os.path.isdir("/foo")
+   True
+
+The overlay directory actually lives under the temporary tree of the fake
+filesystem fixture:
+
+.. doctest::
+
+   >>> filesystem.root.path.startswith(tempfile.gettempdir())
+   True
+   >>> os.listdir(filesystem.root.path)
+   ['foo']
+
+It's possible to operate on the overlay directory as if it was a real
+top-level directory:
+
+.. doctest::
+
+   >>> with open("/foo/bar", "w") as fd:
+   ...    fd.write("Hello world!")
+   12
+   >>> with open("/foo/bar") as fd:
+   ...    fd.read()
+   'Hello world!'
+   >>> os.listdir("/foo")
+   ['bar']
+
+It's possible to change the ownership of files in the overlay directory,
+even without superuser priviliges:
+
+.. doctest::
+
+   >>> os.chown("/foo/bar", 0, 0)
+   >>> os.chmod("/foo/bar", 0o600)
+   >>> info = os.stat("/foo/bar")
+   >>> info.st_uid, info.st_gid
+   (0, 0)
+   >>> oct(info.st_mode)
+   '0o100600'
+
+   >>> filesystem.cleanUp()
+
+Network
++++++++
+
+The :class:`FakeNetwork` fixture is simply fixture-compatible adapter of
+the :class:`requests-mock` package, which provides facilities to stub
+out responses from the :class:`requests` package. For further details
+see the `official documentation <https://requests-mock.readthedocs.io/en/latest/>`_.
+
+.. doctest::
+
... 1290 lines suppressed ...

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/systemfixtures.git



More information about the Python-modules-commits mailing list