Run flake8 across the entire code base (#163)

Also, make sure we're using a consistent version of flake8 in CI.
This commit is contained in:
Jon Parise 2022-05-17 11:41:01 -07:00 committed by GitHub
parent 7102b4560b
commit 2c702b0a39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 5 deletions

View file

@ -2,7 +2,6 @@ import re
import time import time
import unittest import unittest
import uuid import uuid
import json
from unittest import TestCase from unittest import TestCase
from unittest import mock from unittest import mock
from urllib.parse import unquote from urllib.parse import unquote
@ -139,11 +138,15 @@ class SnapPassRoutesTestCase(TestCase):
frozen_time.move_to("2020-05-22 12:00:00") frozen_time.move_to("2020-05-22 12:00:00")
self.assertIsNone(snappass.get_password(key)) self.assertIsNone(snappass.get_password(key))
def test_set_password_json(self): def test_set_password_json(self):
with freeze_time("2020-05-08 12:00:00") as frozen_time: with freeze_time("2020-05-08 12:00:00") as frozen_time:
password = 'my name is my passport. verify me.' 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() json_content = rv.get_json()
key = re.search(r'https://localhost/([^"]+)', json_content['link']).group(1) key = re.search(r'https://localhost/([^"]+)', json_content['link']).group(1)

View file

@ -11,5 +11,5 @@ commands =
[testenv:flake8] [testenv:flake8]
commands = commands =
pip install flake8 pip install -r dev-requirements.txt
flake8 snappass/ flake8