Skip to content

Commit

Permalink
Deployed cb4c285 with MkDocs version: 1.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mjordan committed Feb 22, 2024
1 parent 0763930 commit 994550e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions development_guide/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1098,7 +1098,7 @@ <h2 id="writing-tests">Writing tests</h2>
</ul>
<p>The unit tests are pretty conventional, but the integration tests are a bit more challenging. The two sample tests provided below are copied from <code>islandora_tests.py</code>, and you can see their input files in <code>tests/assets/create_test</code> and <code>tests/assets/max_node_title_length_test</code>, respectively.</p>
<h3 id="a-simple-unit-test">A simple unit test</h3>
<p>This test tests the <code>validate_latlong_value()</code> method from the <code>workbench_utils.py</code> module.</p>
<p>This test, from <code>tests/unit_tests.py</code>, tests the <code>validate_latlong_value()</code> method from the <code>workbench_utils.py</code> module.</p>
<pre><code class="language-python">class TestValidateLatlongValue(unittest.TestCase):

def test_validate_good_latlong_values(self):
Expand All @@ -1113,7 +1113,7 @@ <h3 id="a-simple-unit-test">A simple unit test</h3>
res = workbench_utils.validate_latlong_value(value)
self.assertFalse(res)
</code></pre>
<p>This is a fairly standard Python unit test - we define a list of valid lat/long pairs and run them through the <code>workbench_utils.validate_latlong_value()</code> method expecting it to return <code>True</code> for each value, and then we define a list of bad lat/long pairs, run them through the method expecting it to return <code>False</code> for each value. Since <code>workbench_utils.validate_latlong_value()</code> doesn't interact with Islandora, <code>https://islandora.traefik.me/</code> doesn't need to be available to run this unit test.</p>
<p>This is a fairly standard Python unit test - we define a list of valid lat/long pairs and run them through the <code>workbench_utils.validate_latlong_value()</code> method expecting it to return <code>True</code> for each value, and then we define a list of bad lat/long pairs and run them through the method expecting it to return <code>False</code> for each value. Since <code>workbench_utils.validate_latlong_value()</code> doesn't interact with Islandora, <code>https://islandora.traefik.me/</code> doesn't need to be available to run this unit test.</p>
<h3 id="a-simple-integration-test">A simple integration test</h3>
<p>An example of a simple integration test is <code>TestCreate</code>, whose code (in <code>islandora_tests.py</code>) looks like this (with line numbers added for easy reference):</p>
<pre><code class="language-python">1. class TestCreate(unittest.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion search/search_index.json

Large diffs are not rendered by default.

Binary file modified sitemap.xml.gz
Binary file not shown.

0 comments on commit 994550e

Please sign in to comment.