Fix tests
This commit is contained in:
parent
d88cf2600e
commit
a9fc727240
1 changed files with 4 additions and 4 deletions
8
tests.py
8
tests.py
|
@ -1,7 +1,7 @@
|
||||||
import unittest
|
import unittest
|
||||||
from unittest import TestCase
|
from unittest import TestCase
|
||||||
|
|
||||||
from werkzeug.exceptions import ClientDisconnected
|
from werkzeug.exceptions import BadRequest
|
||||||
|
|
||||||
# noinspection PyPep8Naming
|
# noinspection PyPep8Naming
|
||||||
import snappass.main as snappass
|
import snappass.main as snappass
|
||||||
|
@ -27,17 +27,17 @@ class SnapPassTestCase(TestCase):
|
||||||
# Test Bad Data
|
# Test Bad Data
|
||||||
with snappass.app.test_request_context(
|
with snappass.app.test_request_context(
|
||||||
"/", data={'password': 'foo', 'ttl': 'bar'}, method='POST'):
|
"/", data={'password': 'foo', 'ttl': 'bar'}, method='POST'):
|
||||||
self.assertRaises(ClientDisconnected, snappass.clean_input)
|
self.assertRaises(BadRequest, snappass.clean_input)
|
||||||
|
|
||||||
# No Password
|
# No Password
|
||||||
with snappass.app.test_request_context(
|
with snappass.app.test_request_context(
|
||||||
"/", method='POST'):
|
"/", method='POST'):
|
||||||
self.assertRaises(ClientDisconnected, snappass.clean_input)
|
self.assertRaises(BadRequest, snappass.clean_input)
|
||||||
|
|
||||||
# No TTL
|
# No TTL
|
||||||
with snappass.app.test_request_context(
|
with snappass.app.test_request_context(
|
||||||
"/", data={'password': 'foo'}, method='POST'):
|
"/", data={'password': 'foo'}, method='POST'):
|
||||||
self.assertRaises(ClientDisconnected, snappass.clean_input)
|
self.assertRaises(BadRequest, snappass.clean_input)
|
||||||
|
|
||||||
with snappass.app.test_request_context(
|
with snappass.app.test_request_context(
|
||||||
"/", data={'password': 'foo', 'ttl': 'hour'}, method='POST'):
|
"/", data={'password': 'foo', 'ttl': 'hour'}, method='POST'):
|
||||||
|
|
Loading…
Reference in a new issue