Skip to content

Commit

Permalink
[Feature #145186283] Test timeout is too small
Browse files Browse the repository at this point in the history
  • Loading branch information
kevintumbo committed May 18, 2017
1 parent 5a72d20 commit 8225de2
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions hc/api/tests/test_create_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def test_it_handles_missing_request_body(self):
self.assertEqual(r.json()['error'], "wrong api_key")

def test_it_handles_invalid_json(self):
### Make the post request with invalid json data type
# Make the post request with invalid json data type

payload = {"api_key": "abc", "name": "Foo"}

Expand All @@ -98,4 +98,18 @@ def test_it_rejects_non_string_name(self):
expected_error="name is not a string")

### Test for the assignment of channels
### Test for the 'timeout is too small' and 'timeout is too large' errors

# Test for the 'timeout is too small'
def test_timeout_is_too_small(self):
r = self.post({
"api_key": "abc",
"name": "Foo",
"tags": "bar,baz",
"timeout": 59,
"grace": 60
})

self.assertEqual(r.status_code, 400)
self.assertEqual(r.json()['error'], "timeout is too small")


0 comments on commit 8225de2

Please sign in to comment.