Skip to content

Commit

Permalink
Issue #1329. Add URL tests for new report endpoint.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Taylor committed Feb 28, 2017
1 parent 56c72d2 commit 7539333
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/test_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,17 @@ def test_labeler_webhook(self):
# A random post should 401, only requests from GitHub will 200
self.assertEqual(rv.status_code, 401)

def test_csp_report_uri(self):
headers = {'Content-Type': 'application/csp-report'}
rv = self.app.post('/csp-report', headers=headers)
self.assertEqual(rv.status_code, 204)

def test_csp_report_uri_bad_content_type(self):
headers = {'Content-Type': 'application/json'}
rv = self.app.post('/csp-report', headers=headers)
self.assertNotEqual(rv.status_code, 204)
self.assertEqual(rv.status_code, 400)

def test_tools_cssfixme(self):
'''Test that the /tools/cssfixme route gets 200.'''
rv = self.app.get('/tools/cssfixme')
Expand Down

0 comments on commit 7539333

Please sign in to comment.