3
0
Fork 0

fix: format all code with black

and from now on should not deviate from that...
This commit is contained in:
Lance Edgar 2025-08-31 12:26:43 -05:00
parent 8a09fb1a3c
commit 4d0693862d
68 changed files with 6693 additions and 5659 deletions

View file

@ -36,7 +36,7 @@ class TestView(WebTestCase):
def test_make_grid_action(self):
view = self.make_view()
action = view.make_grid_action('view')
action = view.make_grid_action("view")
self.assertIsInstance(action, GridAction)
def test_notfound(self):
@ -46,31 +46,31 @@ class TestView(WebTestCase):
def test_redirect(self):
view = self.make_view()
error = view.redirect('/')
error = view.redirect("/")
self.assertIsInstance(error, HTTPFound)
self.assertEqual(error.location, '/')
self.assertEqual(error.location, "/")
def test_file_response(self):
view = self.make_view()
# default uses attachment behavior
datfile = self.write_file('dat.txt', 'hello')
datfile = self.write_file("dat.txt", "hello")
response = view.file_response(datfile)
self.assertEqual(response.status_code, 200)
self.assertEqual(response.content_disposition, 'attachment; filename="dat.txt"')
# but can disable attachment behavior
datfile = self.write_file('dat.txt', 'hello')
datfile = self.write_file("dat.txt", "hello")
response = view.file_response(datfile, attachment=False)
self.assertEqual(response.status_code, 200)
self.assertIsNone(response.content_disposition)
# path not found
crapfile = '/does/not/exist'
crapfile = "/does/not/exist"
response = view.file_response(crapfile)
self.assertEqual(response.status_code, 404)
def test_json_response(self):
view = self.make_view()
response = view.json_response({'foo': 'bar'})
response = view.json_response({"foo": "bar"})
self.assertEqual(response.status_code, 200)