Skip S3 write/read test cases

(imported from commit 838c9a5245b45fc9082f753fe6756f270c7378a7)
This commit is contained in:
Luke Faraone
2015-06-10 11:28:32 -07:00
parent 81a2a20bbf
commit 494d02cc35
2 changed files with 9 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ from zerver.views.messages import get_sqlalchemy_connection
import os
import time
import unittest
def slow(expected_run_time, slowness_reason):
@@ -70,7 +71,10 @@ def run_test(test):
start_time = time.time()
test.setUp()
try:
test_method()
except unittest.SkipTest:
pass
test.tearDown()
delay = time.time() - start_time

View File

@@ -3,6 +3,7 @@ from __future__ import absolute_import
from django.conf import settings
from django.core.exceptions import ValidationError
from django.test import TestCase
from unittest import skip
from zerver.forms import not_mit_mailing_list
@@ -45,6 +46,7 @@ class S3Test(AuthedTestCase):
test_keys = [] # keys in authed bucket
@slow(2.6, "has to contact external S3 service")
@skip("Need S3 mock")
def test_file_upload_authed(self):
"""
A call to /json/upload_file should return a uri and actually create an object.
@@ -91,6 +93,8 @@ class S3Test(AuthedTestCase):
def tearDown(self):
# clean up
return
# TODO: un-deadden this code when we have proper S3 mocking.
conn = S3Connection(settings.S3_KEY, settings.S3_SECRET_KEY)
for uri in self.test_uris:
key = Key(conn.get_bucket(settings.S3_BUCKET))