def test_04_validator_reset_file_position(self): # An ugly bug during release extracted = self._extract(True) post = dict(addon_id='hot_pink_bougainvillea', file=FormFile('zigbert.sf', extracted.signature)) request = StupidRequest(path="/1.0/sign_addon", post=post) valid_addon(request) self.assertEqual(request.POST['file'].file.tell(), 0)
def test_05_sign_addons(self): """ Bah! This is currently horked because StupidRequest extends pyramid.testing.DummyRequest which is very much NOT a webob request alike object. """ extracted = self._extract(True) post = dict(addon_id='hot_pink_bougainvillea', file=FormFile('zigbert.sf', extracted.signature)) request = StupidRequest(path="/1.0/sign_addon", post=post) # Call the validator to make sure we replicate the real call stack # as much as possible. valid_addon(request) response = sign_addon(request) signature = response_to_pkcs7(response['zigbert.rsa']) self.assertEqual(get_signature_cert_subject(signature), "OU=Pickle Processing, C=US, L=Calvinville, " "O=Allizom, Cni., ST=Denial, " "CN=hot_pink_bougainvillea")
def test_05_sign_addons(self): """ Bah! This is currently horked because StupidRequest extends pyramid.testing.DummyRequest which is very much NOT a webob request alike object. """ extracted = self._extract(True) post = dict(addon_id='hot_pink_bougainvillea', file=FormFile('zigbert.sf', extracted.signature)) request = StupidRequest(path="/1.0/sign_addon", post=post) # Call the validator to make sure we replicate the real call stack # as much as possible. valid_addon(request) response = sign_addon(request) signature = response_to_pkcs7(response['zigbert.rsa']) self.assertEqual( get_signature_cert_subject(signature), "OU=Pickle Processing, C=US, L=Calvinville, " "O=Allizom, Cni., ST=Denial, " "CN=hot_pink_bougainvillea")