def test_is_broken(self): zip = SafeUnzip(self.packaged_app_path('signed.zip')) zip.is_valid() sf_re = re.compile('^META\-INF/(\w+)\.sf$') for info in zip.info: if sf_re.match(info.filename): info.filename = 'META-INF/foo.foo' break assert not zip.is_signed()
def test_is_secure(self): zip = SafeUnzip(self.packaged_app_path('signed.zip')) zip.is_valid() assert zip.is_signed()
def test_not_secure(self): zip = SafeUnzip(self.packaged_app_path('mozball.zip')) zip.is_valid() assert not zip.is_signed()
def test_is_broken(self): zip = SafeUnzip(self.xpi_path('signed')) zip.is_valid() zip.info[2].filename = 'META-INF/foo.sf' assert not zip.is_signed()
def test_is_secure(self): zip = SafeUnzip(self.xpi_path('signed')) zip.is_valid() assert zip.is_signed()
def test_not_secure(self): zip = SafeUnzip(self.xpi_path('extension')) zip.is_valid() assert not zip.is_signed()