Skip to content

Commit

Permalink
Merge pull request #3163 from stevepiercy/1.8-branch
Browse files Browse the repository at this point in the history
backport #3152 from master to 1.8-branch
  • Loading branch information
stevepiercy authored Aug 15, 2017
2 parents aef32bd + 13cf140 commit b27b3d8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 9 additions & 2 deletions docs/quick_tutorial/static_assets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,20 @@ Steps
.. literalinclude:: static_assets/tutorial/static/app.css
:language: css

#. Make sure we haven't broken any existing code by running the tests:
#. We add a functional test that asserts that the newly added static file is delivered:

.. literalinclude:: static_assets/tutorial/tests.py
:language: python
:pyobject: TutorialFunctionalTests.test_css
:lineno-match:

#. Now run the tests:

.. code-block:: bash
$ $VENV/bin/py.test tutorial/tests.py -q
....
4 passed in 0.50 seconds
5 passed in 0.50 seconds
#. Run your Pyramid application with:

Expand Down
4 changes: 4 additions & 0 deletions docs/quick_tutorial/static_assets/tutorial/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,7 @@ def test_home(self):
def test_hello(self):
res = self.testapp.get('/howdy', status=200)
self.assertIn(b'<h1>Hi Hello View', res.body)

def test_css(self):
res = self.testapp.get('/static/app.css', status=200)
self.assertIn(b'body', res.body)

0 comments on commit b27b3d8

Please sign in to comment.