From 3d67e35447b2e2fed2b6beef938920a346ce746c Mon Sep 17 00:00:00 2001 From: gwen Date: Thu, 22 Aug 2013 12:17:10 +0200 Subject: [PATCH] documentation on the tests --- doc/config.txt | 5 +++++ doc/error.txt | 4 ++-- doc/index.txt | 4 ++-- test/test_config.py | 11 +++++++++-- test/test_option.py | 5 +++++ 5 files changed, 23 insertions(+), 6 deletions(-) diff --git a/doc/config.txt b/doc/config.txt index 2547923..0326e30 100644 --- a/doc/config.txt +++ b/doc/config.txt @@ -94,6 +94,11 @@ And if you wanna come back to a default value, use the builtin `del()` function: .. module:: tiramisu.config +.. _`tree`: + +The handling of options +~~~~~~~~~~~~~~~~~~~~~~~~~~ + The handling of options is split into two parts: the description of which options are available, what their possible values and defaults are and how they are organized into a tree. A specific choice of options is diff --git a/doc/error.txt b/doc/error.txt index f3037a0..3a0bf0e 100644 --- a/doc/error.txt +++ b/doc/error.txt @@ -11,8 +11,8 @@ Three builtins exceptions are used : - **AttributeError** : wrong path or unknownd option or optiondescription -And five user-defined exceptions : ------------------------------------ +And five other exceptions : +------------------------------ .. automodule:: tiramisu.error :members: diff --git a/doc/index.txt b/doc/index.txt index e5b9e12..ee3ae10 100644 --- a/doc/index.txt +++ b/doc/index.txt @@ -35,7 +35,8 @@ configuration handler. consistency error glossary - + test + Indices and tables ================== @@ -52,4 +53,3 @@ This work is licensed under a `Creative Commons Attribution-ShareAlike 3.0 Unpor - diff --git a/test/test_config.py b/test/test_config.py index 02e0341..798db46 100644 --- a/test/test_config.py +++ b/test/test_config.py @@ -1,5 +1,8 @@ # -*- coding: utf-8 -*- -#this test is much more to test that **it's there** and answers attribute access + +"""theses tests are much more to test that config, option description, vs... +**it's there** and answers via attribute access""" + import autopath from py.test import raises @@ -31,6 +34,9 @@ def make_description(): def test_base_config(): + """making a :class:`tiramisu.config.Config()` object + and a :class:`tiramisu.option.OptionDescription()` object + """ gcdummy = BoolOption('dummy', 'dummy', default=False) descr = OptionDescription('tiramisu', '', [gcdummy]) cfg = Config(descr) @@ -79,7 +85,7 @@ def test_base_config_and_groups(): def test_base_config_in_a_tree(): - "how options are organized into a tree" + "how options are organized into a tree, see :ref:`tree`" descr = make_description() config = Config(descr) config.bool = False @@ -114,6 +120,7 @@ def test_base_config_in_a_tree(): def test_cfgimpl_get_home_by_path(): + " :meth:`tiramisu.config.SubConfig.cfgimpl_get_home_by_path()` to retrieve a path" descr = make_description() config = Config(descr) config.bool = False diff --git a/test/test_option.py b/test/test_option.py index a9ce825..e4dc66b 100644 --- a/test/test_option.py +++ b/test/test_option.py @@ -1,9 +1,13 @@ +"""these tests are here to create some :class:`tiramisu.option.Option`'s +and to compare them +""" import autopath from tiramisu.option import BoolOption, IntOption def test_option_comparison(): + "compare :class:`tiramisu.option.BoolOption`" dummy1 = BoolOption('dummy1', 'doc dummy') dummy2 = BoolOption('dummy2', 'doc dummy') dummy3 = BoolOption('dummy1', 'doc dummy') @@ -12,6 +16,7 @@ def test_option_comparison(): def test_option_comparison_obj(): + "compare :class:`tiramisu.option.IntOption`" dummy1 = BoolOption('dummy1', 'doc dummy') dummy2 = IntOption('dummy1', 'doc dummy') assert dummy1 != dummy2