Really removing nosetests things now! all assert_whatever removed
This commit is contained in:
parent
4412385394
commit
7d503a897b
@ -44,7 +44,6 @@ EVIL_PNG = resource('evil.png')
|
||||
BIG_BLUE = resource('bigblue.png')
|
||||
|
||||
|
||||
@pytest.mark.usefixtures("test_app")
|
||||
class TestAPI(object):
|
||||
def setup(self):
|
||||
self.db = mg_globals.database
|
||||
|
@ -17,8 +17,6 @@
|
||||
import urlparse
|
||||
import datetime
|
||||
|
||||
from nose.tools import assert_equal
|
||||
|
||||
from mediagoblin import mg_globals
|
||||
from mediagoblin.auth import lib as auth_lib
|
||||
from mediagoblin.db.models import User
|
||||
@ -101,8 +99,8 @@ def test_register_views(test_app):
|
||||
context = template.TEMPLATE_TEST_CONTEXT['mediagoblin/auth/register.html']
|
||||
form = context['register_form']
|
||||
|
||||
assert_equal (form.username.errors, [u'Field must be between 3 and 30 characters long.'])
|
||||
assert_equal (form.password.errors, [u'Field must be between 5 and 1024 characters long.'])
|
||||
assert form.username.errors == [u'Field must be between 3 and 30 characters long.']
|
||||
assert form.password.errors == [u'Field must be between 5 and 1024 characters long.']
|
||||
|
||||
## bad form
|
||||
template.clear_test_template_context()
|
||||
@ -113,11 +111,11 @@ def test_register_views(test_app):
|
||||
context = template.TEMPLATE_TEST_CONTEXT['mediagoblin/auth/register.html']
|
||||
form = context['register_form']
|
||||
|
||||
assert_equal (form.username.errors, [u'This field does not take email addresses.'])
|
||||
assert_equal (form.email.errors, [u'This field requires an email address.'])
|
||||
assert form.username.errors == [u'This field does not take email addresses.']
|
||||
assert form.email.errors == [u'This field requires an email address.']
|
||||
|
||||
## At this point there should be no users in the database ;)
|
||||
assert_equal(User.query.count(), 0)
|
||||
assert User.query.count() == 0
|
||||
|
||||
# Successful register
|
||||
# -------------------
|
||||
@ -130,9 +128,7 @@ def test_register_views(test_app):
|
||||
response.follow()
|
||||
|
||||
## Did we redirect to the proper page? Use the right template?
|
||||
assert_equal(
|
||||
urlparse.urlsplit(response.location)[2],
|
||||
'/u/happygirl/')
|
||||
assert urlparse.urlsplit(response.location)[2] == '/u/happygirl/'
|
||||
assert 'mediagoblin/user_pages/user.html' in template.TEMPLATE_TEST_CONTEXT
|
||||
|
||||
## Make sure user is in place
|
||||
@ -223,9 +219,7 @@ def test_register_views(test_app):
|
||||
response.follow()
|
||||
|
||||
## Did we redirect to the proper page? Use the right template?
|
||||
assert_equal(
|
||||
urlparse.urlsplit(response.location)[2],
|
||||
'/auth/login/')
|
||||
assert urlparse.urlsplit(response.location)[2] == '/auth/login/'
|
||||
assert 'mediagoblin/auth/login.html' in template.TEMPLATE_TEST_CONTEXT
|
||||
|
||||
## Make sure link to change password is sent by email
|
||||
@ -256,7 +250,7 @@ def test_register_views(test_app):
|
||||
response = test_app.get(
|
||||
"/auth/forgot_password/verify/?userid=%s&token=total_bs" % unicode(
|
||||
new_user.id), status=404)
|
||||
assert_equal(response.status.split()[0], u'404') # status="404 NOT FOUND"
|
||||
assert response.status.split()[0] == u'404' # status="404 NOT FOUND"
|
||||
|
||||
## Try using an expired token to change password, shouldn't work
|
||||
template.clear_test_template_context()
|
||||
@ -265,7 +259,7 @@ def test_register_views(test_app):
|
||||
new_user.fp_token_expire = datetime.datetime.now()
|
||||
new_user.save()
|
||||
response = test_app.get("%s?%s" % (path, get_params), status=404)
|
||||
assert_equal(response.status.split()[0], u'404') # status="404 NOT FOUND"
|
||||
assert response.status.split()[0] == u'404' # status="404 NOT FOUND"
|
||||
new_user.fp_token_expire = real_token_expiration
|
||||
new_user.save()
|
||||
|
||||
@ -293,9 +287,7 @@ def test_register_views(test_app):
|
||||
|
||||
# User should be redirected
|
||||
response.follow()
|
||||
assert_equal(
|
||||
urlparse.urlsplit(response.location)[2],
|
||||
'/')
|
||||
assert urlparse.urlsplit(response.location)[2] == '/'
|
||||
assert 'mediagoblin/root.html' in template.TEMPLATE_TEST_CONTEXT
|
||||
|
||||
|
||||
@ -370,9 +362,7 @@ def test_authentication_views(test_app):
|
||||
|
||||
# User should be redirected
|
||||
response.follow()
|
||||
assert_equal(
|
||||
urlparse.urlsplit(response.location)[2],
|
||||
'/')
|
||||
assert urlparse.urlsplit(response.location)[2] == '/'
|
||||
assert 'mediagoblin/root.html' in template.TEMPLATE_TEST_CONTEXT
|
||||
|
||||
# Make sure user is in the session
|
||||
@ -387,9 +377,7 @@ def test_authentication_views(test_app):
|
||||
|
||||
# Should be redirected to index page
|
||||
response.follow()
|
||||
assert_equal(
|
||||
urlparse.urlsplit(response.location)[2],
|
||||
'/')
|
||||
assert urlparse.urlsplit(response.location)[2] == '/'
|
||||
assert 'mediagoblin/root.html' in template.TEMPLATE_TEST_CONTEXT
|
||||
|
||||
# Make sure the user is not in the session
|
||||
@ -405,6 +393,4 @@ def test_authentication_views(test_app):
|
||||
'username': u'chris',
|
||||
'password': 'toast',
|
||||
'next' : '/u/chris/'})
|
||||
assert_equal(
|
||||
urlparse.urlsplit(response.location)[2],
|
||||
'/u/chris/')
|
||||
assert urlparse.urlsplit(response.location)[2] == '/u/chris/'
|
||||
|
@ -16,7 +16,6 @@
|
||||
|
||||
from mediagoblin.tests.tools import fixture_add_collection, fixture_add_user
|
||||
from mediagoblin.db.models import Collection, User
|
||||
from nose.tools import assert_equal
|
||||
|
||||
|
||||
def test_user_deletes_collection(test_app):
|
||||
@ -30,4 +29,4 @@ def test_user_deletes_collection(test_app):
|
||||
user.delete()
|
||||
cnt2 = Collection.query.count()
|
||||
|
||||
assert_equal(cnt1, cnt2 + 1)
|
||||
assert cnt1 == cnt2 + 1
|
||||
|
@ -14,7 +14,7 @@
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from nose.tools import assert_equal
|
||||
import pytest
|
||||
|
||||
from mediagoblin import mg_globals
|
||||
from mediagoblin.db.models import User
|
||||
@ -69,7 +69,7 @@ class TestUserEdit(object):
|
||||
})
|
||||
|
||||
# Check for redirect on success
|
||||
assert_equal(res.status_int, 302)
|
||||
assert res.status_int == 302
|
||||
# test_user has to be fetched again in order to have the current values
|
||||
test_user = User.query.filter_by(username=u'chris').first()
|
||||
assert bcrypt_check_password('123456', test_user.pw_hash)
|
||||
@ -99,7 +99,7 @@ class TestUserEdit(object):
|
||||
'url': u'http://dustycloud.org/'}, expect_errors=True)
|
||||
|
||||
# Should redirect to /u/chris/edit/
|
||||
assert_equal (res.status_int, 302)
|
||||
assert res.status_int == 302
|
||||
assert res.headers['Location'].endswith("/u/chris/edit/")
|
||||
|
||||
res = test_app.post(
|
||||
@ -108,8 +108,8 @@ class TestUserEdit(object):
|
||||
'url': u'http://dustycloud.org/'})
|
||||
|
||||
test_user = User.query.filter_by(username=u'chris').first()
|
||||
assert_equal(test_user.bio, u'I love toast!')
|
||||
assert_equal(test_user.url, u'http://dustycloud.org/')
|
||||
assert test_user.bio == u'I love toast!'
|
||||
assert test_user.url == u'http://dustycloud.org/'
|
||||
|
||||
# change a different user than the logged in (should fail with 403)
|
||||
fixture_add_user(username=u"foo")
|
||||
@ -117,7 +117,7 @@ class TestUserEdit(object):
|
||||
'/u/foo/edit/', {
|
||||
'bio': u'I love toast!',
|
||||
'url': u'http://dustycloud.org/'}, expect_errors=True)
|
||||
assert_equal(res.status_int, 403)
|
||||
assert res.status_int == 403
|
||||
|
||||
# test changing the bio and the URL inproperly
|
||||
too_long_bio = 150 * 'T' + 150 * 'o' + 150 * 'a' + 150 * 's' + 150* 't'
|
||||
@ -129,10 +129,13 @@ class TestUserEdit(object):
|
||||
'url': 'this-is-no-url'})
|
||||
|
||||
# Check form errors
|
||||
context = template.TEMPLATE_TEST_CONTEXT['mediagoblin/edit/edit_profile.html']
|
||||
context = template.TEMPLATE_TEST_CONTEXT[
|
||||
'mediagoblin/edit/edit_profile.html']
|
||||
form = context['form']
|
||||
|
||||
assert_equal(form.bio.errors, [u'Field must be between 0 and 500 characters long.'])
|
||||
assert_equal(form.url.errors, [u'This address contains errors'])
|
||||
assert form.bio.errors == [
|
||||
u'Field must be between 0 and 500 characters long.']
|
||||
assert form.url.errors == [
|
||||
u'This address contains errors']
|
||||
|
||||
# test changing the url inproperly
|
||||
|
@ -14,7 +14,7 @@
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from nose.tools import assert_raises
|
||||
import pytest
|
||||
|
||||
from mediagoblin import mg_globals
|
||||
|
||||
@ -36,7 +36,7 @@ class TestGlobals(object):
|
||||
assert mg_globals.public_store == 'my favorite public_store!'
|
||||
assert mg_globals.queue_store == 'my favorite queue_store!'
|
||||
|
||||
assert_raises(
|
||||
pytest.raises(
|
||||
AssertionError,
|
||||
mg_globals.setup_globals,
|
||||
no_such_global_foo = "Dummy")
|
||||
no_such_global_foo="Dummy")
|
||||
|
@ -14,8 +14,6 @@
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from nose.tools import assert_equal
|
||||
|
||||
from mediagoblin.db.base import Session
|
||||
from mediagoblin.db.models import User, MediaEntry, MediaComment
|
||||
from mediagoblin.tests.tools import fixture_add_user, fixture_media_entry
|
||||
@ -23,7 +21,7 @@ from mediagoblin.tests.tools import fixture_add_user, fixture_media_entry
|
||||
|
||||
def test_404_for_non_existent(test_app):
|
||||
res = test_app.get('/does-not-exist/', expect_errors=True)
|
||||
assert_equal(res.status_int, 404)
|
||||
assert res.status_int == 404
|
||||
|
||||
|
||||
def test_user_deletes_other_comments(test_app):
|
||||
@ -58,11 +56,11 @@ def test_user_deletes_other_comments(test_app):
|
||||
cmt_cnt2 = MediaComment.query.count()
|
||||
|
||||
# One user deleted
|
||||
assert_equal(usr_cnt2, usr_cnt1 - 1)
|
||||
assert usr_cnt2 == usr_cnt1 - 1
|
||||
# One media gone
|
||||
assert_equal(med_cnt2, med_cnt1 - 1)
|
||||
assert med_cnt2 == med_cnt1 - 1
|
||||
# Three of four comments gone.
|
||||
assert_equal(cmt_cnt2, cmt_cnt1 - 3)
|
||||
assert cmt_cnt2 == cmt_cnt1 - 3
|
||||
|
||||
User.query.get(user_b.id).delete()
|
||||
|
||||
@ -71,11 +69,11 @@ def test_user_deletes_other_comments(test_app):
|
||||
cmt_cnt2 = MediaComment.query.count()
|
||||
|
||||
# All users gone
|
||||
assert_equal(usr_cnt2, usr_cnt1 - 2)
|
||||
assert usr_cnt2 == usr_cnt1 - 2
|
||||
# All media gone
|
||||
assert_equal(med_cnt2, med_cnt1 - 2)
|
||||
assert med_cnt2 == med_cnt1 - 2
|
||||
# All comments gone
|
||||
assert_equal(cmt_cnt2, cmt_cnt1 - 4)
|
||||
assert cmt_cnt2 == cmt_cnt1 - 4
|
||||
|
||||
|
||||
def test_media_deletes_broken_attachment(test_app):
|
||||
|
@ -17,8 +17,6 @@
|
||||
# Maybe not every model needs a test, but some models have special
|
||||
# methods, and so it makes sense to test them here.
|
||||
|
||||
from nose.tools import assert_equal
|
||||
|
||||
from mediagoblin.db.base import Session
|
||||
from mediagoblin.db.models import MediaEntry
|
||||
|
||||
@ -166,4 +164,4 @@ def test_media_data_init(test_app):
|
||||
for obj in Session():
|
||||
obj_in_session += 1
|
||||
print repr(obj)
|
||||
assert_equal(obj_in_session, 0)
|
||||
assert obj_in_session == 0
|
||||
|
@ -19,7 +19,6 @@ from configobj import ConfigObj
|
||||
from mediagoblin import mg_globals
|
||||
from mediagoblin.init.plugins import setup_plugins
|
||||
from mediagoblin.tools import pluginapi
|
||||
from nose.tools import eq_
|
||||
|
||||
|
||||
def with_cleanup(*modules_to_delete):
|
||||
@ -97,7 +96,7 @@ def test_no_plugins():
|
||||
setup_plugins()
|
||||
|
||||
# Make sure we didn't load anything.
|
||||
eq_(len(pman.plugins), 0)
|
||||
assert len(pman.plugins) == 0
|
||||
|
||||
|
||||
@with_cleanup('mediagoblin.plugins.sampleplugin')
|
||||
@ -117,14 +116,14 @@ def test_one_plugin():
|
||||
setup_plugins()
|
||||
|
||||
# Make sure we only found one plugin
|
||||
eq_(len(pman.plugins), 1)
|
||||
assert len(pman.plugins) == 1
|
||||
# Make sure the plugin is the one we think it is.
|
||||
eq_(pman.plugins[0], 'mediagoblin.plugins.sampleplugin')
|
||||
assert pman.plugins[0] == 'mediagoblin.plugins.sampleplugin'
|
||||
# Make sure there was one hook registered
|
||||
eq_(len(pman.hooks), 1)
|
||||
assert len(pman.hooks) == 1
|
||||
# Make sure _setup_plugin_called was called once
|
||||
import mediagoblin.plugins.sampleplugin
|
||||
eq_(mediagoblin.plugins.sampleplugin._setup_plugin_called, 1)
|
||||
assert mediagoblin.plugins.sampleplugin._setup_plugin_called == 1
|
||||
|
||||
|
||||
@with_cleanup('mediagoblin.plugins.sampleplugin')
|
||||
@ -145,14 +144,14 @@ def test_same_plugin_twice():
|
||||
setup_plugins()
|
||||
|
||||
# Make sure we only found one plugin
|
||||
eq_(len(pman.plugins), 1)
|
||||
assert len(pman.plugins) == 1
|
||||
# Make sure the plugin is the one we think it is.
|
||||
eq_(pman.plugins[0], 'mediagoblin.plugins.sampleplugin')
|
||||
assert pman.plugins[0] == 'mediagoblin.plugins.sampleplugin'
|
||||
# Make sure there was one hook registered
|
||||
eq_(len(pman.hooks), 1)
|
||||
assert len(pman.hooks) == 1
|
||||
# Make sure _setup_plugin_called was called once
|
||||
import mediagoblin.plugins.sampleplugin
|
||||
eq_(mediagoblin.plugins.sampleplugin._setup_plugin_called, 1)
|
||||
assert mediagoblin.plugins.sampleplugin._setup_plugin_called == 1
|
||||
|
||||
|
||||
@with_cleanup()
|
||||
@ -172,4 +171,4 @@ def test_disabled_plugin():
|
||||
setup_plugins()
|
||||
|
||||
# Make sure we didn't load the plugin
|
||||
eq_(len(pman.plugins), 0)
|
||||
assert len(pman.plugins) == 0
|
||||
|
@ -18,7 +18,7 @@
|
||||
import os
|
||||
import tempfile
|
||||
|
||||
from nose.tools import assert_raises, assert_equal, assert_true
|
||||
import pytest
|
||||
from werkzeug.utils import secure_filename
|
||||
|
||||
from mediagoblin import storage
|
||||
@ -41,10 +41,8 @@ def test_clean_listy_filepath():
|
||||
assert storage.clean_listy_filepath(
|
||||
['../../../etc/', 'passwd']) == expected
|
||||
|
||||
assert_raises(
|
||||
storage.InvalidFilepath,
|
||||
storage.clean_listy_filepath,
|
||||
['../../', 'linooks.jpg'])
|
||||
with pytest.raises(storage.InvalidFilepath):
|
||||
storage.clean_listy_filepath(['../../', 'linooks.jpg'])
|
||||
|
||||
|
||||
class FakeStorageSystem():
|
||||
@ -78,10 +76,10 @@ def test_storage_system_from_config():
|
||||
'garbage_arg': 'garbage_arg',
|
||||
'storage_class':
|
||||
'mediagoblin.tests.test_storage:FakeStorageSystem'})
|
||||
assert_equal(this_storage.foobie, 'eiboof')
|
||||
assert_equal(this_storage.blech, 'hcelb')
|
||||
assert_equal(unicode(this_storage.__class__),
|
||||
u'mediagoblin.tests.test_storage.FakeStorageSystem')
|
||||
assert this_storage.foobie == 'eiboof'
|
||||
assert this_storage.blech == 'hcelb'
|
||||
assert unicode(this_storage.__class__) == \
|
||||
u'mediagoblin.tests.test_storage.FakeStorageSystem'
|
||||
|
||||
|
||||
##########################
|
||||
@ -108,7 +106,7 @@ def test_basic_storage__resolve_filepath():
|
||||
assert result == os.path.join(
|
||||
tmpdir, 'etc/passwd')
|
||||
|
||||
assert_raises(
|
||||
pytest.raises(
|
||||
storage.InvalidFilepath,
|
||||
this_storage._resolve_filepath,
|
||||
['../../', 'etc', 'passwd'])
|
||||
@ -205,7 +203,7 @@ def test_basic_storage_delete_file():
|
||||
def test_basic_storage_url_for_file():
|
||||
# Not supplying a base_url should actually just bork.
|
||||
tmpdir, this_storage = get_tmp_filestorage()
|
||||
assert_raises(
|
||||
pytest.raises(
|
||||
storage.NoWebServing,
|
||||
this_storage.file_url,
|
||||
['dir1', 'dir2', 'filename.txt'])
|
||||
|
@ -21,7 +21,6 @@ sys.setdefaultencoding('utf-8')
|
||||
import urlparse
|
||||
import os
|
||||
|
||||
from nose.tools import assert_equal, assert_true
|
||||
from pkg_resources import resource_filename
|
||||
|
||||
from mediagoblin.tests.tools import fixture_add_user
|
||||
@ -87,7 +86,7 @@ class TestSubmission:
|
||||
|
||||
def check_comments(self, request, media_id, count):
|
||||
comments = request.db.MediaComment.find({'media_entry': media_id})
|
||||
assert_equal(count, len(list(comments)))
|
||||
assert count == len(list(comments))
|
||||
|
||||
def test_missing_fields(self, test_app):
|
||||
self._setup(test_app)
|
||||
@ -95,21 +94,21 @@ class TestSubmission:
|
||||
# Test blank form
|
||||
# ---------------
|
||||
response, form = self.do_post({}, *FORM_CONTEXT)
|
||||
assert_equal(form.file.errors, [u'You must provide a file.'])
|
||||
assert form.file.errors == [u'You must provide a file.']
|
||||
|
||||
# Test blank file
|
||||
# ---------------
|
||||
response, form = self.do_post({'title': u'test title'}, *FORM_CONTEXT)
|
||||
assert_equal(form.file.errors, [u'You must provide a file.'])
|
||||
assert form.file.errors == [u'You must provide a file.']
|
||||
|
||||
def check_url(self, response, path):
|
||||
assert_equal(urlparse.urlsplit(response.location)[2], path)
|
||||
assert urlparse.urlsplit(response.location)[2] == path
|
||||
|
||||
def check_normal_upload(self, title, filename):
|
||||
response, context = self.do_post({'title': title}, do_follow=True,
|
||||
**self.upload_data(filename))
|
||||
self.check_url(response, '/u/{0}/'.format(self.test_user.username))
|
||||
assert_true('mediagoblin/user_pages/user.html' in context)
|
||||
assert 'mediagoblin/user_pages/user.html' in context
|
||||
# Make sure the media view is at least reachable, logged in...
|
||||
url = '/u/{0}/m/{1}/'.format(self.test_user.username,
|
||||
title.lower().replace(' ', '-'))
|
||||
@ -129,7 +128,7 @@ class TestSubmission:
|
||||
def check_media(self, request, find_data, count=None):
|
||||
media = MediaEntry.find(find_data)
|
||||
if count is not None:
|
||||
assert_equal(media.count(), count)
|
||||
assert media.count() == count
|
||||
if count == 0:
|
||||
return
|
||||
return media[0]
|
||||
@ -156,10 +155,10 @@ class TestSubmission:
|
||||
'tags': BAD_TAG_STRING},
|
||||
*FORM_CONTEXT,
|
||||
**self.upload_data(GOOD_JPG))
|
||||
assert_equal(form.tags.errors, [
|
||||
assert form.tags.errors == [
|
||||
u'Tags must be shorter than 50 characters. ' \
|
||||
'Tags that are too long: ' \
|
||||
'ffffffffffffffffffffffffffuuuuuuuuuuuuuuuuuuuuuuuuuu'])
|
||||
'ffffffffffffffffffffffffffuuuuuuuuuuuuuuuuuuuuuuuuuu']
|
||||
|
||||
def test_delete(self, test_app):
|
||||
self._setup(test_app)
|
||||
@ -180,7 +179,7 @@ class TestSubmission:
|
||||
'slug': u"Balanced=Goblin",
|
||||
'tags': u''})
|
||||
media = self.check_media(request, {'title': u'Balanced Goblin'}, 1)
|
||||
assert_equal(media.slug, u"balanced-goblin")
|
||||
assert media.slug == u"balanced-goblin"
|
||||
|
||||
# Add a comment, so we can test for its deletion later.
|
||||
self.check_comments(request, media_id, 0)
|
||||
@ -216,7 +215,7 @@ class TestSubmission:
|
||||
response, form = self.do_post({'title': u'Malicious Upload 1'},
|
||||
*FORM_CONTEXT,
|
||||
**self.upload_data(EVIL_FILE))
|
||||
assert_equal(len(form.file.errors), 1)
|
||||
assert len(form.file.errors) == 1
|
||||
assert 'Sorry, I don\'t support that file type :(' == \
|
||||
str(form.file.errors[0])
|
||||
|
||||
@ -231,8 +230,8 @@ class TestSubmission:
|
||||
**self.upload_data(GOOD_JPG))
|
||||
media = self.check_media(request, {'title': u'Balanced Goblin'}, 1)
|
||||
|
||||
assert_equal(media.media_type, u'mediagoblin.media_types.image')
|
||||
assert_equal(media.media_manager, img_MEDIA_MANAGER)
|
||||
assert media.media_type == u'mediagoblin.media_types.image'
|
||||
assert media.media_manager == img_MEDIA_MANAGER
|
||||
|
||||
|
||||
def test_sniffing(self, test_app):
|
||||
@ -267,8 +266,8 @@ class TestSubmission:
|
||||
**self.upload_data(filename))
|
||||
self.check_url(response, '/u/{0}/'.format(self.test_user.username))
|
||||
entry = mg_globals.database.MediaEntry.find_one({'title': title})
|
||||
assert_equal(entry.state, 'failed')
|
||||
assert_equal(entry.fail_error, u'mediagoblin.processing:BadMediaFail')
|
||||
assert entry.state == 'failed'
|
||||
assert entry.fail_error == u'mediagoblin.processing:BadMediaFail'
|
||||
|
||||
def test_evil_jpg(self, test_app):
|
||||
self._setup(test_app)
|
||||
@ -289,7 +288,7 @@ class TestSubmission:
|
||||
|
||||
self.check_normal_upload(u"With GPS data", GPS_JPG)
|
||||
media = self.check_media(None, {"title": u"With GPS data"}, 1)
|
||||
assert_equal(media.media_data.gps_latitude, 59.336666666666666)
|
||||
assert media.media_data.gps_latitude == 59.336666666666666
|
||||
|
||||
def test_processing(self, test_app):
|
||||
self._setup(test_app)
|
||||
@ -309,8 +308,8 @@ class TestSubmission:
|
||||
filename = os.path.join(
|
||||
public_store_dir,
|
||||
*media.media_files.get(key, []))
|
||||
assert_true(filename.endswith('_' + basename))
|
||||
assert filename.endswith('_' + basename)
|
||||
# Is it smaller than the last processed image we looked at?
|
||||
size = os.stat(filename).st_size
|
||||
assert_true(last_size > size)
|
||||
assert last_size > size
|
||||
last_size = size
|
||||
|
@ -50,9 +50,9 @@ USER_DEV_DIRECTORIES_TO_SETUP = [
|
||||
'beaker/sessions/data', 'beaker/sessions/lock']
|
||||
|
||||
BAD_CELERY_MESSAGE = """\
|
||||
Sorry, you *absolutely* must run nosetests with the
|
||||
Sorry, you *absolutely* must run tests with the
|
||||
mediagoblin.init.celery.from_tests module. Like so:
|
||||
$ CELERY_CONFIG_MODULE=mediagoblin.init.celery.from_tests ./bin/nosetests"""
|
||||
$ CELERY_CONFIG_MODULE=mediagoblin.init.celery.from_tests ./bin/py.test"""
|
||||
|
||||
|
||||
class BadCeleryEnviron(Exception): pass
|
||||
|
Loading…
x
Reference in New Issue
Block a user