Beispiel #1
0
 def test_unpublish(self):
     setup_mock_response('UpdateCerts')
     app = mock.Mock()
     app.iarc_cert.cert_id = 'adb3261bc6574fd2a057bc9f85310b80'
     res = unpublish(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': 'RemoveProduct',
             'CertID': 'adb3261b-c657-4fd2-a057-bc9f85310b80'
         }]
     })
Beispiel #2
0
 def test_unpublish(self):
     setup_mock_response('UpdateCerts')
     app = mock.Mock()
     app.iarc_cert.cert_id = 'adb3261bc6574fd2a057bc9f85310b80'
     res = unpublish(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': 'RemoveProduct',
                 'CertID': 'adb3261b-c657-4fd2-a057-bc9f85310b80'
             }]
         })
Beispiel #3
0
 def test_unpublish(self):
     setup_mock_response('UpdateCerts')
     app = app_factory()
     IARCCert.objects.create(
         app=app, cert_id='adb3261bc6574fd2a057bc9f85310b80')
     res = unpublish(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': 'Unpublish',
             'CertID': 'adb3261b-c657-4fd2-a057-bc9f85310b80'
         }]
     })
Beispiel #4
0
 def test_unpublish(self):
     setup_mock_response('UpdateCerts')
     app = app_factory()
     IARCCert.objects.create(
         app=app, cert_id='adb3261bc6574fd2a057bc9f85310b80')
     res = unpublish(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': 'RemoveProduct',
             'CertID': 'adb3261b-c657-4fd2-a057-bc9f85310b80'
         }]
     })
Beispiel #5
0
 def test_unpublish_no_cert(self):
     app = Webapp()
     res = unpublish(app)
     eq_(res, None)
     eq_(len(responses.calls), 0)
Beispiel #6
0
 def test_unpublish_no_cert(self):
     res = unpublish(42)
     eq_(res, None)
     eq_(len(responses.calls), 0)
Beispiel #7
0
 def test_unpublish_no_cert(self):
     app = Webapp()
     res = unpublish(app)
     eq_(res, None)
     eq_(len(responses.calls), 0)
Beispiel #8
0
 def test_unpublish_no_cert(self):
     res = unpublish(42)
     eq_(res, None)
     eq_(len(responses.calls), 0)