From d5c2df371a79fa32331b1526b0277ab624f7a686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 26 Apr 2016 11:11:33 +0200 Subject: [PATCH] Small test change: do as little as possible in an app test context. --- tests/test_file_storage.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/test_file_storage.py b/tests/test_file_storage.py index ac7671dc..efe700d3 100644 --- a/tests/test_file_storage.py +++ b/tests/test_file_storage.py @@ -21,9 +21,9 @@ class FileUploadingTest(AbstractPillarTest): with self.app.test_request_context(): self.ensure_project_exists() - resp = self.client.post('/files', - data=json_file, - headers={'Content-Type': 'application/json'}) + resp = self.client.post('/files', + data=json_file, + headers={'Content-Type': 'application/json'}) self.assertEqual(422, resp.status_code) @@ -39,15 +39,15 @@ class FileUploadingTest(AbstractPillarTest): with self.app.test_request_context(): self.ensure_project_exists() - target_dir = os.path.join(self.app.config['SHARED_DIR'], filename[:2]) - if os.path.exists(target_dir): - assert os.path.isdir(target_dir) - else: - os.makedirs(target_dir) - shutil.copy(os.path.join(MY_PATH, filename), target_dir) + target_dir = os.path.join(self.app.config['SHARED_DIR'], filename[:2]) + if os.path.exists(target_dir): + assert os.path.isdir(target_dir) + else: + os.makedirs(target_dir) + shutil.copy(os.path.join(MY_PATH, filename), target_dir) - resp = self.client.post('/files', - data=json_file, - headers={'Content-Type': 'application/json'}) + resp = self.client.post('/files', + data=json_file, + headers={'Content-Type': 'application/json'}) self.assertEqual(201, resp.status_code)