From 681754eade356e2313641acd726ce333bac8724b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Mon, 2 May 2016 11:12:19 +0200 Subject: [PATCH] Removed some obsolete unit tests. --- tests/test_encoding.py | 9 ------- tests/test_file_storage.py | 53 -------------------------------------- 2 files changed, 62 deletions(-) delete mode 100644 tests/test_file_storage.py diff --git a/tests/test_encoding.py b/tests/test_encoding.py index d1b3afd2..883e9989 100644 --- a/tests/test_encoding.py +++ b/tests/test_encoding.py @@ -17,15 +17,6 @@ class ZencoderNotificationTest(AbstractPillarTest): headers={'X-Zencoder-Notification-Secret': 'koro'}) self.assertEqual(401, resp.status_code) - def test_good_secret_missing_file(self): - with self.app.test_request_context(): - secret = self.app.config['ZENCODER_NOTIFICATIONS_SECRET'] - resp = self.client.post('/encoding/zencoder/notifications', - data=json.dumps({'job': {'id': 'koro-007'}}), - headers={'X-Zencoder-Notification-Secret': secret, - 'Content-Type': 'application/json'}) - self.assertEqual(200, resp.status_code) - def test_good_secret_existing_file(self): self.ensure_file_exists(file_overrides={ 'processing': {'backend': 'zencoder', diff --git a/tests/test_file_storage.py b/tests/test_file_storage.py deleted file mode 100644 index efe700d3..00000000 --- a/tests/test_file_storage.py +++ /dev/null @@ -1,53 +0,0 @@ -"""Test cases for file handling.""" - -from __future__ import print_function - -import os -import shutil -import copy -import json - -from common_test_class import AbstractPillarTest, MY_PATH -from common_test_data import EXAMPLE_FILE - - -class FileUploadingTest(AbstractPillarTest): - def test_create_file_missing_on_fs(self): - from application.utils import PillarJSONEncoder, remove_private_keys - - to_post = remove_private_keys(EXAMPLE_FILE) - json_file = json.dumps(to_post, cls=PillarJSONEncoder) - - with self.app.test_request_context(): - self.ensure_project_exists() - - resp = self.client.post('/files', - data=json_file, - headers={'Content-Type': 'application/json'}) - - self.assertEqual(422, resp.status_code) - - def test_create_file_exists_on_fs(self): - from application.utils import PillarJSONEncoder, remove_private_keys - - filename = 'BlenderDesktopLogo.png' - full_file = copy.deepcopy(EXAMPLE_FILE) - full_file[u'name'] = filename - to_post = remove_private_keys(full_file) - json_file = json.dumps(to_post, cls=PillarJSONEncoder) - - 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) - - resp = self.client.post('/files', - data=json_file, - headers={'Content-Type': 'application/json'}) - - self.assertEqual(201, resp.status_code)