Skip to content

Commit

Permalink
Merge pull request #5 from jantineflendrie/master
Browse files Browse the repository at this point in the history
PR #1 Class 13
  • Loading branch information
chielpeters90 authored Aug 9, 2019
2 parents ac648f8 + 0d8a155 commit c597658
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
14 changes: 14 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
language: python
python:
- "3.6"

install:
- pip install -r requirements.txt

script:
- python -m unittest discover
- coverage erase
- coverage run -m pytest && coverage html

after_success:
- codecov
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ Flask
Flask-BasicAuth
codecov
pylint
pytest
10 changes: 9 additions & 1 deletion tests/test_flaskapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,20 @@ def test_unauthorized(self):

def test_multiply(self):
response = self.app.get('/multiply?x=5&y=7')
resp = json.loads(response.data)
resp = json.loads(response.data.decode())
self.assertEqual(resp['answer'],35,'Multiply endpoint failed known answer 7*5 = 35')

def test_touppercase(self):
response = self.app.get('/touppercase?s=jantine')
self.assertEqual(response.data.decode(), 'JANTINE', 'Touppercase endpoint failed known answer is JANTINE')

# TODO DEFINE TWO MORE TESTS ON THE END POINTS

def test_touppercase2(self):
response = self.app.get('/touppercase?s=jantine')
self.assertEqual(response.data.decode(), 'JANTINE', 'Touppercase endpoint failed known answer is JANTINE')
# TODO DEFINE TWO MORE TESTS ON THE END POINTS


if __name__ == '__main__':
unittest.main()

0 comments on commit c597658

Please sign in to comment.