def test_put_request(self): req = PutRequest("http://example.com/") req.data('{"test":"best"}', "application/json") real = req._request() self.assertEqual(real.get_data(), '{"test":"best"}') self.assertEqual(real.get_method(), "PUT")
def _put(self,item): put_url = urljoin(self.url, item["resource_uri"]) req = PutRequest(put_url) req.data(json.dumps(item), "application/json") req.header("Authorization", self.api_auth) req.put()