Skip to content

Commit

Permalink
[#3635] Fix missing code snippets in Testing doc page
Browse files Browse the repository at this point in the history
In the "Testing coding standards" doc page, some code snippets were missing
due to having double "#" in the "start-after" and "end-before" statements.
  • Loading branch information
Aleksandar Jovanov committed Jun 24, 2017
1 parent 3ff0284 commit 15645be
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions ckan/tests/logic/action/__init__.py
Expand Up @@ -27,8 +27,8 @@
Here's an example of a simple :mod:`ckan.logic.action` test:
.. literalinclude:: ../../ckan/tests/logic/action/test_update.py
:start-after: ## START-AFTER
:end-before: ## END-BEFORE
:start-after: # START-AFTER
:end-before: # END-BEFORE
.. todo::
Expand Down
4 changes: 2 additions & 2 deletions ckan/tests/logic/auth/__init__.py
Expand Up @@ -13,7 +13,7 @@
Here's an example of a simple :py:mod:`ckan.logic.auth` test:
.. literalinclude:: ../../ckan/tests/logic/auth/test_update.py
:start-after: ## START-AFTER
:end-before: ## END-BEFORE
:start-after: # START-AFTER
:end-before: # END-BEFORE
'''
16 changes: 8 additions & 8 deletions doc/contributing/testing.rst
Expand Up @@ -206,17 +206,17 @@ Most CKAN tests should follow this form. Here's an example of a simple action
function test demonstrating the recipe:

.. literalinclude:: /../ckan/tests/logic/action/test_update.py
:start-after: ## START-AFTER
:end-before: ## END-BEFORE
:start-after: # START-AFTER
:end-before: # END-BEFORE

One common exception is when you want to use a ``for`` loop to call the
function being tested multiple times, passing it lots of different arguments
that should all produce the same return value and/or side effects. For example,
this test from :py:mod:`ckan.tests.logic.action.test_update`:

.. literalinclude:: /../ckan/tests/logic/action/test_update.py
:start-after: ## START-FOR-LOOP-EXAMPLE
:end-before: ## END-FOR-LOOP-EXAMPLE
:start-after: # START-FOR-LOOP-EXAMPLE
:end-before: # END-FOR-LOOP-EXAMPLE

The behavior of :py:func:`~ckan.logic.action.update.user_update` is the same
for every invalid value.
Expand Down Expand Up @@ -342,8 +342,8 @@ going on, but here's an example of a test from
out :py:mod:`ckan.model`:

.. literalinclude:: /../ckan/tests/logic/auth/test_update.py
:start-after: ## START-AFTER
:end-before: ## END-BEFORE
:start-after: # START-AFTER
:end-before: # END-BEFORE

----

Expand Down Expand Up @@ -412,8 +412,8 @@ make these common asserts easy. To use one of these decorators you have to:
Here's an example of a simple validator test that uses this technique:

.. literalinclude:: /../ckan/tests/logic/test_validators.py
:start-after: ## START-AFTER
:end-before: ## END-BEFORE
:start-after: # START-AFTER
:end-before: # END-BEFORE


No tests for :mod:`ckan.logic.schema.py`
Expand Down

0 comments on commit 15645be

Please sign in to comment.