diff --git a/tests.py b/tests.py index 3994793..1c385f9 100644 --- a/tests.py +++ b/tests.py @@ -2,7 +2,6 @@ import re import time import unittest import uuid -import json from unittest import TestCase from unittest import mock from urllib.parse import unquote @@ -139,11 +138,15 @@ class SnapPassRoutesTestCase(TestCase): frozen_time.move_to("2020-05-22 12:00:00") self.assertIsNone(snappass.get_password(key)) - + def test_set_password_json(self): with freeze_time("2020-05-08 12:00:00") as frozen_time: password = 'my name is my passport. verify me.' - rv = self.app.post('/', headers={'Accept': 'application/json'}, data={'password': password, 'ttl': 'two weeks'}) + rv = self.app.post( + '/', + headers={'Accept': 'application/json'}, + data={'password': password, 'ttl': 'two weeks'}, + ) json_content = rv.get_json() key = re.search(r'https://localhost/([^"]+)', json_content['link']).group(1) diff --git a/tox.ini b/tox.ini index 616303d..17d4d79 100644 --- a/tox.ini +++ b/tox.ini @@ -11,5 +11,5 @@ commands = [testenv:flake8] commands = - pip install flake8 - flake8 snappass/ + pip install -r dev-requirements.txt + flake8