Skip to content

Commit

Permalink
Test and configuration documentation updated
Browse files Browse the repository at this point in the history
  • Loading branch information
mmulich committed Nov 27, 2011
1 parent e1acf0b commit e10ae2c
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 15 deletions.
17 changes: 12 additions & 5 deletions docs/source/config.rst
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
Configuration (pkgmeta.cfg)
===========================

In order to setup a repository, one needs to configure using a basic INI file.
In order to setup a repository, one needs to configure
one or more repositories using a basic INI file.

The configuration fairly simple. There is one INI section that is special,
it is called ``pkgmeta``. This section is used to configure globals.
The configuration is fairly simple.
There is one INI section that is special,
it is called ``pkgmeta``. This section is used to configure global settings.
Any other sections in the file are repository definitions.

Example configuration
---------------------

The following configuration selects the ``myrepo`` as the default repository. The ``myrepo`` repository using the filesystem storage type and sources from ``pkgmeta.org``.
The following configuration selects the ``myrepo`` as the default repository.
The ``myrepo`` repository is using the filesystem storage type
and sources from ``pkgmeta.org``.
::

[pkgmeta]
default = myrepo

[myrepo]
type = fs
type = filesystem
sources =
http://repo.pkgmeta.org/ pypi
http://repo.pkgmeta.org/ private

.. todo:: Currently, the sources implementation is not complete. Stay tuned for
more information.
3 changes: 2 additions & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ Contents:
.. toctree::
:maxdepth: 2

installation
install
example
config
tests
changes

Expand Down
26 changes: 17 additions & 9 deletions docs/source/tests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,31 @@ Testing
Running the tests
-----------------

To test the package, use unittest test discovery::
To test the package, use unittest test discovery, by running the following
within the pkgmeta's package root::

$ python -m unittest discover

Or for those of you using Python <= 2.6, you'll need to install unittest2
first. Then run the ``unit2`` script::
.. Or for those of you using Python <= 2.6, you'll need to install unittest2
first. Then run the ``unit2`` script::
$ pip install unittest2
$ unit2 discover
$ pip install unittest2
$ unit2 discover
Coverage reports
----------------

Calling python within coverage's run command doesn't work because of the ``-m`` option flag given to python. So you'll need to
create a script similar to unittest2's ``unit2``.

I created a script called ``testrunner.py`` and placed it outside the package, because you'll receive import errors if you put it along side the package you are trying to discover. The scripts contents are::
Calling python within coverage's run command doesn't work
because of the ``-m`` option flag given to python
conflicts with the coverage command options.
So you'll need to create a script similar to unittest2's ``unit2``.

To solve the fore mentioned issue, I created a script called ``testrunner.py``
and placed it in my home directory.
You can place the script anywhere outside the package root.
If you put the script within the package, you will receive import errors
when trying to do test discovery.
The scripts contents are::

# -*- coding: utf-8 -*-
"""Unittest test runner script"""
Expand Down

0 comments on commit e10ae2c

Please sign in to comment.