Change remaining apps/ paths in the code to src/olympia

That will hopefully fix the travis builds, at least making them run
properly.
This commit is contained in:
Mathieu Pillard 2015-12-23 14:39:55 +01:00 коммит произвёл Christopher Grebs
Родитель c6d1cc2d66
Коммит 45a1fa120e
18 изменённых файлов: 48 добавлений и 48 удалений

Просмотреть файл

@ -46,13 +46,13 @@ All being well it should look like this::
""") """)
:/opt/rh/python27/root/usr/lib/python2.7/site-packages/celery/utils/__init__.py:93 :/opt/rh/python27/root/usr/lib/python2.7/site-packages/celery/utils/__init__.py:93
> /code/apps/browse/views.py(148)themes() > /code/src/olympia/browse/views.py(148)themes()
147 import ipdb;ipdb.set_trace() 147 import ipdb;ipdb.set_trace()
--> 148 TYPE = amo.ADDON_THEME --> 148 TYPE = amo.ADDON_THEME
149 if category is not None: 149 if category is not None:
ipdb> n ipdb> n
> /code/apps/browse/views.py(149)themes() > /code/src/olympia/browse/views.py(149)themes()
148 TYPE = amo.ADDON_THEME 148 TYPE = amo.ADDON_THEME
--> 149 if category is not None: --> 149 if category is not None:
150 q = Category.objects.filter(application=request.APP.id, type=TYPE) 150 q = Category.objects.filter(application=request.APP.id, type=TYPE)

Просмотреть файл

@ -69,7 +69,7 @@ To fail and stop running tests on the first failure::
If you wish to add arguments, or run a specific test, overload the variables If you wish to add arguments, or run a specific test, overload the variables
(check the Makefile for more information):: (check the Makefile for more information)::
make test ARGS='-v apps/amo/tests/test_url_prefix.py::MiddlewareTest::test_get_app' make test ARGS='-v src/olympia/amo/tests/test_url_prefix.py::MiddlewareTest::test_get_app'
If you wish to re-run only the tests failed from the previous run:: If you wish to re-run only the tests failed from the previous run::

Просмотреть файл

@ -17,7 +17,7 @@ methods:
* `py.test -m es_tests` to run the tests that are marked_ as `es_tests` * `py.test -m es_tests` to run the tests that are marked_ as `es_tests`
* `py.test -k test_no_license` to run all the tests that have * `py.test -k test_no_license` to run all the tests that have
`test_no_license` in their name `test_no_license` in their name
* `py.test apps/addons/tests/test_views.py::TestLicensePage::test_no_license` * `py.test src/olympia/addons/tests/test_views.py::TestLicensePage::test_no_license`
to run only this specific test to run only this specific test
You'll find more documentation on this on the `Pytest usage documentation`_. You'll find more documentation on this on the `Pytest usage documentation`_.

Просмотреть файл

@ -1,6 +1,6 @@
{# these are custom attributes on <div class="install ..."> found in {# these are custom attributes on <div class="install ..."> found in
# apps/addons/templates/addons/impala/button.html and # src/olympia/addons/templates/addons/impala/button.html and
# apps/addons/templates/addons/mobile/button.html #} # src/olympia/addons/templates/addons/mobile/button.html #}
data-addon="{{ addon.id }}" data-addon="{{ addon.id }}"
data-icon="{{ addon.icon_url }}" data-icon="{{ addon.icon_url }}"
data-developers="{{ addon.meet_the_dev_url() }}" data-developers="{{ addon.meet_the_dev_url() }}"

Просмотреть файл

@ -564,7 +564,7 @@ class AMOPaths(object):
"""Mixin for getting common AMO Paths.""" """Mixin for getting common AMO Paths."""
def file_fixture_path(self, name): def file_fixture_path(self, name):
path = 'apps/files/fixtures/files/%s' % name path = 'src/olympia/files/fixtures/files/%s' % name
return os.path.join(settings.ROOT, path) return os.path.join(settings.ROOT, path)
def xpi_path(self, name): def xpi_path(self, name):

Просмотреть файл

@ -316,7 +316,7 @@ class TestAddon(BaseOAuth):
def setUp(self): def setUp(self):
super(TestAddon, self).setUp() super(TestAddon, self).setUp()
path = 'apps/files/fixtures/files/extension.xpi' path = 'src/olympia/files/fixtures/files/extension.xpi'
xpi = os.path.join(settings.ROOT, path) xpi = os.path.join(settings.ROOT, path)
f = open(xpi) f = open(xpi)
@ -326,7 +326,7 @@ class TestAddon(BaseOAuth):
platform='mac', platform='mac',
xpi=f) xpi=f)
path = 'apps/files/fixtures/files/extension-0.2.xpi' path = 'src/olympia/files/fixtures/files/extension-0.2.xpi'
self.version_data = dict(builtin=2, platform='windows', self.version_data = dict(builtin=2, platform='windows',
xpi=open(os.path.join(settings.ROOT, path))) xpi=open(os.path.join(settings.ROOT, path)))
self.update_data = dict(name='fu', self.update_data = dict(name='fu',
@ -591,7 +591,7 @@ class TestAddon(BaseOAuth):
a = Addon.objects.get(pk=id) a = Addon.objects.get(pk=id)
v = a.versions.get() v = a.versions.get()
eq_(v.version, '0.1') eq_(v.version, '0.1')
return a, v, 'apps/files/fixtures/files/extension-0.2.xpi' return a, v, 'src/olympia/files/fixtures/files/extension-0.2.xpi'
def test_update_version_no_license(self): def test_update_version_no_license(self):
a, v, path = self.create_for_update() a, v, path = self.create_for_update()

Просмотреть файл

@ -150,7 +150,7 @@ class TestValidator(TestCase):
self.upload.update( self.upload.update(
path=os.path.join(settings.ROOT, path=os.path.join(settings.ROOT,
'apps/devhub/tests/addons/desktop.xpi')) 'src/olympia/devhub/tests/addons/desktop.xpi'))
assert self.upload.validation is None assert self.upload.validation is None

Просмотреть файл

@ -442,7 +442,7 @@ class TestValidationAnnotatorBase(TestCase):
# Create a FileUpload object for an XPI containing version 1.1. # Create a FileUpload object for an XPI containing version 1.1.
path = os.path.join(settings.ROOT, path = os.path.join(settings.ROOT,
'apps/devhub/tests/addons/desktop.xpi') 'src/olympia/devhub/tests/addons/desktop.xpi')
self.file_upload = FileUpload.objects.create(path=path) self.file_upload = FileUpload.objects.create(path=path)
self.xpi_version = '1.1' self.xpi_version = '1.1'

Просмотреть файл

@ -57,7 +57,7 @@ class TestUploadValidation(BaseUploadTest):
eq_(doc('td').text(), 'December 6, 2010') eq_(doc('td').text(), 'December 6, 2010')
def test_upload_processed_validation(self): def test_upload_processed_validation(self):
addon_file = open('apps/files/fixtures/files/validation-error.xpi') addon_file = open('src/olympia/files/fixtures/files/validation-error.xpi')
response = self.client.post(reverse('devhub.upload'), response = self.client.post(reverse('devhub.upload'),
{'name': 'addon.xpi', {'name': 'addon.xpi',
'upload': addon_file}) 'upload': addon_file})
@ -405,7 +405,7 @@ class TestUploadURLs(TestCase):
FileUpload.objects.all().delete() FileUpload.objects.all().delete()
self.run_validator.reset_mock() self.run_validator.reset_mock()
with open('apps/files/fixtures/files/validation-error.xpi') as file_: with open('src/olympia/files/fixtures/files/validation-error.xpi') as file_:
resp = self.client.post(reverse(view, kwargs=kw), resp = self.client.post(reverse(view, kwargs=kw),
{'upload': file_}) {'upload': file_})
assert resp.status_code == 302 assert resp.status_code == 302

Просмотреть файл

@ -19,7 +19,7 @@ from olympia.files.helpers import FileViewer, DiffHelper
from olympia.files.models import File from olympia.files.models import File
from olympia.files.utils import SafeUnzip from olympia.files.utils import SafeUnzip
root = os.path.join(settings.ROOT, 'apps/files/fixtures/files') root = os.path.join(settings.ROOT, 'src/olympia/files/fixtures/files')
def get_file(filename): def get_file(filename):

Просмотреть файл

@ -356,7 +356,7 @@ class TestParseXpi(TestCase):
version=version) version=version)
def parse(self, addon=None, filename='extension.xpi'): def parse(self, addon=None, filename='extension.xpi'):
path = 'apps/files/fixtures/files/' + filename path = 'src/olympia/files/fixtures/files/' + filename
xpi = os.path.join(settings.ROOT, path) xpi = os.path.join(settings.ROOT, path)
return parse_addon(open(xpi), addon) return parse_addon(open(xpi), addon)
@ -1158,7 +1158,7 @@ def test_parse_addon(search_mock, xpi_mock):
def test_parse_xpi(): def test_parse_xpi():
"""Fire.fm can sometimes give us errors. Let's prevent that.""" """Fire.fm can sometimes give us errors. Let's prevent that."""
firefm = os.path.join(settings.ROOT, firefm = os.path.join(settings.ROOT,
'apps/files/fixtures/files/firefm.xpi') 'src/olympia/files/fixtures/files/firefm.xpi')
rdf = parse_xpi(open(firefm)) rdf = parse_xpi(open(firefm))
eq_(rdf['name'], 'Fire.fm') eq_(rdf['name'], 'Fire.fm')

Просмотреть файл

@ -12,7 +12,7 @@ from olympia.versions.models import Version
# Very basic js file that contains a `let`, a `const`, and a `var` in the # Very basic js file that contains a `let`, a `const`, and a `var` in the
# toplevel scope. Both the `let` and `const` should be rewritten to `var`. # toplevel scope. Both the `let` and `const` should be rewritten to `var`.
TEST_JS_FILE = 'apps/files/fixtures/files/test_with_toplevel_let.js' TEST_JS_FILE = 'src/olympia/files/fixtures/files/test_with_toplevel_let.js'
def assert_test_file_fixed(filename): def assert_test_file_fixed(filename):
@ -48,7 +48,7 @@ def test_fix_let_scope_bustage_in_xpi(mock_fixer):
The two files that should be fixed are some_file.js and foobar/main.js. The two files that should be fixed are some_file.js and foobar/main.js.
Both those files have the same content as the TEST_JS_FILE. Both those files have the same content as the TEST_JS_FILE.
""" """
test_xpi = 'apps/files/fixtures/files/extension-let-global-scope.xpi' test_xpi = 'src/olympia/files/fixtures/files/extension-let-global-scope.xpi'
with amo.tests.copy_file_to_temp(test_xpi) as temp_filename: with amo.tests.copy_file_to_temp(test_xpi) as temp_filename:
tasks.fix_let_scope_bustage_in_xpi(temp_filename) tasks.fix_let_scope_bustage_in_xpi(temp_filename)
mock_fixer.assert_called_once_with(mock.ANY, mock.ANY) mock_fixer.assert_called_once_with(mock.ANY, mock.ANY)
@ -74,7 +74,7 @@ def test_fix_let_scope_bustage_in_addon(mock_sign_file, mock_version_bump,
assert addon.versions.count() == 2 # Two versions, we only fix the last. assert addon.versions.count() == 2 # Two versions, we only fix the last.
# Assign a file for the last version's file. # Assign a file for the last version's file.
test_xpi = 'apps/files/fixtures/files/extension-let-global-scope.xpi' test_xpi = 'src/olympia/files/fixtures/files/extension-let-global-scope.xpi'
file_ = File.objects.create(version=version, filename='foo.xpi', file_ = File.objects.create(version=version, filename='foo.xpi',
is_signed=True) is_signed=True)
with override_settings(PRELIMINARY_SIGNING_SERVER='prelim_signing'): with override_settings(PRELIMINARY_SIGNING_SERVER='prelim_signing'):

Просмотреть файл

@ -419,7 +419,7 @@ class TestManifestJSONExtractor(TestCase):
def test_zip_folder_content(): def test_zip_folder_content():
extension_file = 'apps/files/fixtures/files/extension.xpi' extension_file = 'src/olympia/files/fixtures/files/extension.xpi'
try: try:
temp_folder = utils.extract_zip(extension_file) temp_folder = utils.extract_zip(extension_file)
assert os.listdir(temp_folder) == [ assert os.listdir(temp_folder) == [
@ -439,7 +439,7 @@ def test_zip_folder_content():
def test_repack(): def test_repack():
# Warning: context managers all the way down. Because they're awesome. # Warning: context managers all the way down. Because they're awesome.
extension_file = 'apps/files/fixtures/files/extension.xpi' extension_file = 'src/olympia/files/fixtures/files/extension.xpi'
# We don't want to overwrite our fixture, so use a copy. # We don't want to overwrite our fixture, so use a copy.
with amo.tests.copy_file_to_temp(extension_file) as temp_filename: with amo.tests.copy_file_to_temp(extension_file) as temp_filename:
# This is where we're really testing the repack helper. # This is where we're really testing the repack helper.
@ -468,7 +468,7 @@ def file_obj():
def test_bump_version_in_install_rdf(file_obj): def test_bump_version_in_install_rdf(file_obj):
with amo.tests.copy_file('apps/files/fixtures/files/jetpack.xpi', with amo.tests.copy_file('src/olympia/files/fixtures/files/jetpack.xpi',
file_obj.file_path): file_obj.file_path):
utils.update_version_number(file_obj, '1.3.1-signed') utils.update_version_number(file_obj, '1.3.1-signed')
parsed = utils.parse_xpi(file_obj.file_path) parsed = utils.parse_xpi(file_obj.file_path)
@ -476,7 +476,7 @@ def test_bump_version_in_install_rdf(file_obj):
def test_bump_version_in_alt_install_rdf(file_obj): def test_bump_version_in_alt_install_rdf(file_obj):
with amo.tests.copy_file('apps/files/fixtures/files/alt-rdf.xpi', with amo.tests.copy_file('src/olympia/files/fixtures/files/alt-rdf.xpi',
file_obj.file_path): file_obj.file_path):
utils.update_version_number(file_obj, '2.1.106.1-signed') utils.update_version_number(file_obj, '2.1.106.1-signed')
parsed = utils.parse_xpi(file_obj.file_path) parsed = utils.parse_xpi(file_obj.file_path)
@ -485,7 +485,7 @@ def test_bump_version_in_alt_install_rdf(file_obj):
def test_bump_version_in_package_json(file_obj): def test_bump_version_in_package_json(file_obj):
with amo.tests.copy_file( with amo.tests.copy_file(
'apps/files/fixtures/files/new-format-0.0.1.xpi', 'src/olympia/files/fixtures/files/new-format-0.0.1.xpi',
file_obj.file_path): file_obj.file_path):
utils.update_version_number(file_obj, '0.0.1.1-signed') utils.update_version_number(file_obj, '0.0.1.1-signed')
parsed = utils.parse_xpi(file_obj.file_path) parsed = utils.parse_xpi(file_obj.file_path)

Просмотреть файл

@ -22,8 +22,8 @@ from olympia.files.helpers import DiffHelper, FileViewer
from olympia.files.models import File from olympia.files.models import File
from olympia.users.models import UserProfile from olympia.users.models import UserProfile
dictionary = 'apps/files/fixtures/files/dictionary-test.xpi' dictionary = 'src/olympia/files/fixtures/files/dictionary-test.xpi'
unicode_filenames = 'apps/files/fixtures/files/unicode-filenames.xpi' unicode_filenames = 'src/olympia/files/fixtures/files/unicode-filenames.xpi'
not_binary = 'install.js' not_binary = 'install.js'
binary = 'dictionaries/ar.dic' binary = 'dictionaries/ar.dic'

Просмотреть файл

@ -218,7 +218,7 @@ class TestPackaged(TestCase):
assert packaged.is_signed(self.file_.file_path) assert packaged.is_signed(self.file_.file_path)
def test_sign_file_multi_package(self): def test_sign_file_multi_package(self):
with amo.tests.copy_file('apps/files/fixtures/files/multi-package.xpi', with amo.tests.copy_file('src/olympia/files/fixtures/files/multi-package.xpi',
self.file_.file_path, overwrite=True): self.file_.file_path, overwrite=True):
self.file_.update(is_multi_package=True) self.file_.update(is_multi_package=True)
self.assert_not_signed() self.assert_not_signed()
@ -323,7 +323,7 @@ class TestTasks(TestCase):
"""Don't bump nor sign unreviewed files.""" """Don't bump nor sign unreviewed files."""
for status in (amo.UNREVIEWED_STATUSES + (amo.STATUS_BETA,)): for status in (amo.UNREVIEWED_STATUSES + (amo.STATUS_BETA,)):
self.file_.update(status=amo.STATUS_UNREVIEWED) self.file_.update(status=amo.STATUS_UNREVIEWED)
with amo.tests.copy_file('apps/files/fixtures/files/jetpack.xpi', with amo.tests.copy_file('src/olympia/files/fixtures/files/jetpack.xpi',
self.file_.file_path): self.file_.file_path):
file_hash = self.file_.generate_hash() file_hash = self.file_.generate_hash()
assert self.version.version == '1.3' assert self.version.version == '1.3'
@ -344,10 +344,10 @@ class TestTasks(TestCase):
backup_file2_path = u'{0}.backup_signature'.format( backup_file2_path = u'{0}.backup_signature'.format(
self.file2.file_path) self.file2.file_path)
try: try:
with amo.tests.copy_file('apps/files/fixtures/files/jetpack.xpi', with amo.tests.copy_file('src/olympia/files/fixtures/files/jetpack.xpi',
self.file_.file_path): self.file_.file_path):
with amo.tests.copy_file( with amo.tests.copy_file(
'apps/files/fixtures/files/jetpack.xpi', 'src/olympia/files/fixtures/files/jetpack.xpi',
self.file2.file_path): self.file2.file_path):
file_hash = self.file_.generate_hash() file_hash = self.file_.generate_hash()
file2_hash = self.file2.generate_hash() file2_hash = self.file2.generate_hash()
@ -372,7 +372,7 @@ class TestTasks(TestCase):
"""Use the full signing server if files are fully reviewed.""" """Use the full signing server if files are fully reviewed."""
self.file_.update(status=amo.STATUS_PUBLIC) self.file_.update(status=amo.STATUS_PUBLIC)
with amo.tests.copy_file( with amo.tests.copy_file(
'apps/files/fixtures/files/jetpack.xpi', 'src/olympia/files/fixtures/files/jetpack.xpi',
self.file_.file_path): self.file_.file_path):
tasks.sign_addons([self.addon.pk]) tasks.sign_addons([self.addon.pk])
mock_sign_file.assert_called_with( mock_sign_file.assert_called_with(
@ -383,7 +383,7 @@ class TestTasks(TestCase):
"""Use the prelim signing server if files aren't fully reviewed.""" """Use the prelim signing server if files aren't fully reviewed."""
self.file_.update(status=amo.STATUS_LITE) self.file_.update(status=amo.STATUS_LITE)
with amo.tests.copy_file( with amo.tests.copy_file(
'apps/files/fixtures/files/jetpack.xpi', 'src/olympia/files/fixtures/files/jetpack.xpi',
self.file_.file_path): self.file_.file_path):
tasks.sign_addons([self.addon.pk]) tasks.sign_addons([self.addon.pk])
mock_sign_file.assert_called_with( mock_sign_file.assert_called_with(
@ -400,7 +400,7 @@ class TestTasks(TestCase):
assert file_hash == self.file_.generate_hash() assert file_hash == self.file_.generate_hash()
self.assert_no_backup() self.assert_no_backup()
with amo.tests.copy_file('apps/files/fixtures/files/jetpack.xpi', with amo.tests.copy_file('src/olympia/files/fixtures/files/jetpack.xpi',
self.file_.file_path): self.file_.file_path):
file_hash = self.file_.generate_hash() file_hash = self.file_.generate_hash()
assert self.version.version == '1.3' assert self.version.version == '1.3'
@ -428,7 +428,7 @@ class TestTasks(TestCase):
"""Sign files which have non-ascii filenames.""" """Sign files which have non-ascii filenames."""
self.file_.update(filename=u'jétpack.xpi') self.file_.update(filename=u'jétpack.xpi')
with amo.tests.copy_file( with amo.tests.copy_file(
'apps/files/fixtures/files/jetpack.xpi', 'src/olympia/files/fixtures/files/jetpack.xpi',
self.file_.file_path): self.file_.file_path):
file_hash = self.file_.generate_hash() file_hash = self.file_.generate_hash()
assert self.version.version == '1.3' assert self.version.version == '1.3'
@ -446,7 +446,7 @@ class TestTasks(TestCase):
"""Sign versions which have non-ascii version numbers.""" """Sign versions which have non-ascii version numbers."""
self.version.update(version=u'é1.3') self.version.update(version=u'é1.3')
with amo.tests.copy_file( with amo.tests.copy_file(
'apps/files/fixtures/files/jetpack.xpi', 'src/olympia/files/fixtures/files/jetpack.xpi',
self.file_.file_path): self.file_.file_path):
file_hash = self.file_.generate_hash() file_hash = self.file_.generate_hash()
assert self.version.version == u'é1.3' assert self.version.version == u'é1.3'
@ -463,7 +463,7 @@ class TestTasks(TestCase):
def test_sign_bump_old_versions_default_compat(self, mock_sign_file): def test_sign_bump_old_versions_default_compat(self, mock_sign_file):
"""Sign files which are old, but default to compatible.""" """Sign files which are old, but default to compatible."""
with amo.tests.copy_file( with amo.tests.copy_file(
'apps/files/fixtures/files/jetpack.xpi', 'src/olympia/files/fixtures/files/jetpack.xpi',
self.file_.file_path): self.file_.file_path):
file_hash = self.file_.generate_hash() file_hash = self.file_.generate_hash()
assert self.version.version == '1.3' assert self.version.version == '1.3'
@ -481,7 +481,7 @@ class TestTasks(TestCase):
def test_sign_bump_new_versions_not_default_compat(self, mock_sign_file): def test_sign_bump_new_versions_not_default_compat(self, mock_sign_file):
"""Sign files which are recent, event if not default to compatible.""" """Sign files which are recent, event if not default to compatible."""
with amo.tests.copy_file( with amo.tests.copy_file(
'apps/files/fixtures/files/jetpack.xpi', 'src/olympia/files/fixtures/files/jetpack.xpi',
self.file_.file_path): self.file_.file_path):
file_hash = self.file_.generate_hash() file_hash = self.file_.generate_hash()
assert self.version.version == '1.3' assert self.version.version == '1.3'
@ -499,7 +499,7 @@ class TestTasks(TestCase):
@mock.patch('lib.crypto.tasks.sign_file') @mock.patch('lib.crypto.tasks.sign_file')
def test_dont_resign_dont_bump_version_in_model(self, mock_sign_file): def test_dont_resign_dont_bump_version_in_model(self, mock_sign_file):
with amo.tests.copy_file( with amo.tests.copy_file(
'apps/files/fixtures/files/new-addon-signature.xpi', 'src/olympia/files/fixtures/files/new-addon-signature.xpi',
self.file_.file_path): self.file_.file_path):
self.file_.update(is_signed=True) self.file_.update(is_signed=True)
file_hash = self.file_.generate_hash() file_hash = self.file_.generate_hash()
@ -530,7 +530,7 @@ class TestTasks(TestCase):
@mock.patch('lib.crypto.tasks.sign_file') @mock.patch('lib.crypto.tasks.sign_file')
def test_dont_sign_dont_bump_sign_error(self, mock_sign_file): def test_dont_sign_dont_bump_sign_error(self, mock_sign_file):
mock_sign_file.side_effect = IOError() mock_sign_file.side_effect = IOError()
with amo.tests.copy_file('apps/files/fixtures/files/jetpack.xpi', with amo.tests.copy_file('src/olympia/files/fixtures/files/jetpack.xpi',
self.file_.file_path): self.file_.file_path):
file_hash = self.file_.generate_hash() file_hash = self.file_.generate_hash()
assert self.version.version == '1.3' assert self.version.version == '1.3'
@ -546,7 +546,7 @@ class TestTasks(TestCase):
@mock.patch('lib.crypto.tasks.sign_file') @mock.patch('lib.crypto.tasks.sign_file')
def test_dont_bump_not_signed(self, mock_sign_file): def test_dont_bump_not_signed(self, mock_sign_file):
mock_sign_file.return_value = None # Pretend we didn't sign. mock_sign_file.return_value = None # Pretend we didn't sign.
with amo.tests.copy_file('apps/files/fixtures/files/jetpack.xpi', with amo.tests.copy_file('src/olympia/files/fixtures/files/jetpack.xpi',
self.file_.file_path): self.file_.file_path):
file_hash = self.file_.generate_hash() file_hash = self.file_.generate_hash()
assert self.version.version == '1.3' assert self.version.version == '1.3'
@ -562,7 +562,7 @@ class TestTasks(TestCase):
@mock.patch('lib.crypto.tasks.sign_file') @mock.patch('lib.crypto.tasks.sign_file')
def test_resign_bump_version_in_model_if_force(self, mock_sign_file): def test_resign_bump_version_in_model_if_force(self, mock_sign_file):
with amo.tests.copy_file( with amo.tests.copy_file(
'apps/files/fixtures/files/new-addon-signature.xpi', 'src/olympia/files/fixtures/files/new-addon-signature.xpi',
self.file_.file_path): self.file_.file_path):
self.file_.update(is_signed=True) self.file_.update(is_signed=True)
file_hash = self.file_.generate_hash() file_hash = self.file_.generate_hash()

Просмотреть файл

@ -167,7 +167,7 @@ class TestUploadVersion(BaseUploadVersionCase):
assert not qs.exists() assert not qs.exists()
response = self.put( response = self.put(
addon=guid, version='0.1', addon=guid, version='0.1',
filename='apps/files/fixtures/files/experiment.xpi') filename='src/olympia/files/fixtures/files/experiment.xpi')
assert response.status_code == 201 assert response.status_code == 201
assert qs.exists() assert qs.exists()
addon = qs.get() addon = qs.get()
@ -183,7 +183,7 @@ class TestUploadVersion(BaseUploadVersionCase):
assert not qs.exists() assert not qs.exists()
response = self.put( response = self.put(
addon=guid, version='0.1', addon=guid, version='0.1',
filename='apps/files/fixtures/files/experiment.xpi') filename='src/olympia/files/fixtures/files/experiment.xpi')
assert response.status_code == 400 assert response.status_code == 400
assert response.data['error'] == ( assert response.data['error'] == (
'You cannot submit this type of add-on') 'You cannot submit this type of add-on')

Просмотреть файл

@ -17,7 +17,7 @@ from olympia.stats.models import DownloadCount, ThemeUpdateCount, UpdateCount
from olympia.zadmin.models import DownloadSource from olympia.zadmin.models import DownloadSource
hive_folder = os.path.join(settings.ROOT, 'apps/stats/fixtures/files') hive_folder = os.path.join(settings.ROOT, 'src/olympia/stats/fixtures/files')
class FixturesFolderMixin(object): class FixturesFolderMixin(object):

Просмотреть файл

@ -5,7 +5,7 @@ envlist = es, addons-devhub-editors, main, flake8, docs, assets
basepython = python2.7 basepython = python2.7
install_command = pip install --no-deps --exists-action=w --find-links https://pyrepo.stage.mozaws.net/wheelhouse/ --find-links https://pyrepo.stage.mozaws.net/ --no-index {opts} {packages} install_command = pip install --no-deps --exists-action=w --find-links https://pyrepo.stage.mozaws.net/wheelhouse/ --find-links https://pyrepo.stage.mozaws.net/ --no-index {opts} {packages}
setenv = setenv =
PYTHONPATH=apps PYTHONPATH=src
whitelist_externals = whitelist_externals =
make make
npm npm
@ -23,12 +23,12 @@ commands =
[testenv:addons-devhub-editors] [testenv:addons-devhub-editors]
deps = {[base]deps} deps = {[base]deps}
commands = commands =
py.test --create-db -n 3 -m 'not es_tests' -v apps/addons/ apps/devhub/ apps/editors/ {posargs} py.test --create-db -n 3 -m 'not es_tests' -v src/olympia/addons/ src/olympia/devhub/ src/olympia/editors/ {posargs}
[testenv:main] [testenv:main]
deps = {[base]deps} deps = {[base]deps}
commands = commands =
py.test --create-db -n 3 -m 'not es_tests' -v --ignore apps/addons/ --ignore apps/devhub/ --ignore apps/editors/ {posargs} py.test --create-db -n 3 -m 'not es_tests' -v --ignore src/olympia/addons/ --ignore src/olympia/devhub/ --ignore src/olympia/editors/ {posargs}
[testenv:assets] [testenv:assets]
deps = {[base]deps} deps = {[base]deps}