Example #1
0
 def test_publish(self):
     setup_mock_response('UpdateCerts')
     app = mock.Mock()
     app.iarc_cert.cert_id = 'adb3261bc6574fd2a057bc9f85310b80'
     res = publish(app)
     eq_(res['ResultList'][0]['ResultCode'], 'Success')
     eq_(len(responses.calls), 1)
     eq_(responses.calls[0].request.url,
         urljoin(settings.IARC_V2_SERVICE_ENDPOINT, 'UpdateCerts'))
     eq_(json.loads(responses.calls[0].request.body), {
         'UpdateList': [{
             'Action': 'Publish',
             'CertID': 'adb3261b-c657-4fd2-a057-bc9f85310b80'
         }]
     })
Example #2
0
 def test_publish(self):
     setup_mock_response('UpdateCerts')
     app = mock.Mock()
     app.iarc_cert.cert_id = 'adb3261bc6574fd2a057bc9f85310b80'
     res = publish(app)
     eq_(res['ResultList'][0]['ResultCode'], 'Success')
     eq_(len(responses.calls), 1)
     eq_(responses.calls[0].request.url,
         urljoin(settings.IARC_V2_SERVICE_ENDPOINT, 'UpdateCerts'))
     eq_(
         json.loads(responses.calls[0].request.body), {
             'UpdateList': [{
                 'Action': 'Publish',
                 'CertID': 'adb3261b-c657-4fd2-a057-bc9f85310b80'
             }]
         })
Example #3
0
 def test_publish(self):
     setup_mock_response('UpdateCerts')
     app = app_factory()
     IARCCert.objects.create(
         app=app, cert_id='adb3261bc6574fd2a057bc9f85310b80')
     res = publish(app.pk)
     eq_(res['ResultList'][0]['ResultCode'], 'Success')
     eq_(len(responses.calls), 1)
     eq_(responses.calls[0].request.headers.get('StorePassword'),
         settings.IARC_V2_STORE_PASSWORD)
     eq_(responses.calls[0].request.headers.get('StoreID'),
         settings.IARC_V2_STORE_ID)
     eq_(json.loads(responses.calls[0].request.body), {
         'UpdateList': [{
             'Action': 'Publish',
             'CertID': 'adb3261b-c657-4fd2-a057-bc9f85310b80'
         }]
     })
Example #4
0
 def test_publish(self):
     setup_mock_response('UpdateCerts')
     app = app_factory()
     IARCCert.objects.create(
         app=app, cert_id='adb3261bc6574fd2a057bc9f85310b80')
     res = publish(app.pk)
     eq_(res['ResultList'][0]['ResultCode'], 'Success')
     eq_(len(responses.calls), 1)
     eq_(responses.calls[0].request.headers.get('StorePassword'),
         settings.IARC_V2_STORE_PASSWORD)
     eq_(responses.calls[0].request.headers.get('StoreID'),
         settings.IARC_V2_STORE_ID)
     eq_(json.loads(responses.calls[0].request.body), {
         'UpdateList': [{
             'Action': 'Publish',
             'CertID': 'adb3261b-c657-4fd2-a057-bc9f85310b80'
         }]
     })
Example #5
0
 def test_publish_no_cert(self):
     app = Webapp()
     res = publish(app)
     eq_(res, None)
     eq_(len(responses.calls), 0)
Example #6
0
 def test_publish_no_cert(self):
     res = publish(42)
     eq_(res, None)
     eq_(len(responses.calls), 0)
Example #7
0
 def test_publish_no_cert(self):
     app = Webapp()
     res = publish(app)
     eq_(res, None)
     eq_(len(responses.calls), 0)
Example #8
0
 def test_publish_no_cert(self):
     res = publish(42)
     eq_(res, None)
     eq_(len(responses.calls), 0)