Beispiel #1
0
 def test_do_patch(self):
     httpretty.register_uri(httpretty.PATCH,
                            self.uri,
                            status=self.status_ok,
                            body=json.dumps(self.resp))
     cert_store = Client(self.apikey, self.cert_path, self.uri)
     cert_store.set_url()
     result = cert_store.do_patch(self.header, self.request)
     content = json.loads(result.content)
     self.assertEqual(self.status_ok, result.status_code)
     self.assertEqual(0, content["ErrCode"])
Beispiel #2
0
 def test_do_patch(self):
     httpretty.register_uri(httpretty.PATCH,
                            self.uri,
                            status=self.status_ok,
                            body=json.dumps(self.resp))
     cert_store = Client(
         self.apikey,
         #self.cert_path,
         self.sig_param,
         self.uri,
         True,
         cert=('./tls/client.pem', './tls/client.key'),
         cacert='./tls/ca.crt')
     # cert_store.set_url()
     result = cert_store.do_patch(self.uri, self.header, self.request)
     content = json.loads(result.content)
     self.assertEqual(self.status_ok, result.status_code)
     self.assertEqual(0, content["ErrCode"])