def test_generate_hash(self, storage_mock): f = File() f.version = Version() # Mock remote storage to use a local file instead of a remote one. storage_mock.open = open filename = self.packaged_app_path('mozball.zip') assert f.generate_hash(filename).startswith('sha256:ad85d6316166d4')
def test_generate_hash(self, storage_mock): f = File() f.version = Version() # Mock remote storage to use a local file instead of a remote one. storage_mock.open = open filename = self.packaged_app_path('mozball.zip') assert f.generate_hash(filename).startswith('sha256:ad85d6316166d4')
def test_generate_hash(self): f = File() f.version = Version.objects.get() fn = self.packaged_app_path('mozball.zip') assert f.generate_hash(fn).startswith('sha256:ad85d6316166d4')
def test_generate_filename_ja(self): f = File() f.version = Version(version='0.1.7') f.version.addon = Webapp(name=u' フォクすけ といっしょ') eq_(f.generate_filename(), 'none-0.1.7.webapp')
def test_generate_webapp_fn_partial_non_ascii(self): f = File() f.version = Version(version='0.1.7') f.version.addon = Webapp(app_slug=u'myapp フォクすけ といっしょ') eq_(f.generate_filename(), 'myapp-0.1.7.webapp')
def test_generate_filename_ja(self): f = File() f.version = Version(version='0.1.7') f.version.addon = Webapp(name=u' フォクすけ といっしょ') eq_(f.generate_filename(), 'none-0.1.7.webapp')
def test_generate_webapp_fn_partial_non_ascii(self): f = File() f.version = Version(version='0.1.7') f.version.addon = Webapp(app_slug=u'myapp フォクすけ といっしょ') eq_(f.generate_filename(), 'myapp-0.1.7.webapp')
def test_generate_webapp_fn_partial_non_ascii(self): f = File() f.version = Version(version='0.1.7') f.version.addon = Addon(app_slug=u'myapp フォクすけ といっしょ', type=amo.ADDON_WEBAPP) eq_(f.generate_filename(), 'myapp-0.1.7.webapp')