Skip to content
This repository has been archived by the owner on May 31, 2019. It is now read-only.

Commit

Permalink
Enhancement coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
c-bata committed Jan 1, 2017
1 parent e899535 commit 747e841
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 0 additions & 2 deletions kobin/environs.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,6 @@ def status_code(self):
@property
def status(self):
""" The HTTP status line as a string (e.g. ``404 Not Found``)."""
if not 100 <= self._status_code <= 999:
raise ValueError('Status code out of range.')
status = _HTTP_STATUS_LINES.get(self._status_code)
return str(status or ('{} Unknown'.format(self._status_code)))

Expand Down
8 changes: 8 additions & 0 deletions tests/test_environs.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,14 @@ def test_set_status(self):
response.status = 200
self.assertEqual(response.status, '200 OK')

def test_set_invalid_status(self):
response = BaseResponse()

def set_status(status):
response.status = status

self.assertRaises(ValueError, set_status, -1)

def test_constructor_headerlist(self):
response = BaseResponse()
expected_content_type = ('Content-Type', 'text/plain;')
Expand Down

0 comments on commit 747e841

Please sign in to comment.