Browse Source

add tests for package

master
Charles Reid 1 year ago
parent
commit
c09315fd0f
3 changed files with 18 additions and 3 deletions
  1. +1
    -0
      package/requirements.txt
  2. +4
    -3
      package/setup.py
  3. +13
    -0
      package/tests/test_homepage.py

+ 1
- 0
package/requirements.txt View File

@@ -0,0 +1 @@
Flask>=1.0

+ 4
- 3
package/setup.py View File

@@ -1,9 +1,8 @@
from setuptools import setup

"""
setup.py for the-simplest-flask-package

The simplest python package you can imagine that contains a flask app.
setup.py for the simplest flask package,
the simplest python package you can imagine that contains a flask app.
"""

version="1.0"
@@ -13,6 +12,8 @@ config = {
'version' : version,
'install_requires': ['flask'],
'include_package_data' : True,
'test_suite': 'nose.collector',
'tests_require': ['nose'],
'packages': ['simple','simple.webapp'],
'package_dir' : {
'simple' : 'src',

+ 13
- 0
package/tests/test_homepage.py View File

@@ -0,0 +1,13 @@
from simple.webapp import app
import unittest

class TheSimplestFlaskTest(unittest.TestCase):
def test_simple_flask_package(self):
client = app.test_client()

r = client.get('/')
assert b'Hello world!' in r.data

r = client.get('/florence')
assert b'Hello florence!' in r.data


Loading…
Cancel
Save