Advertisement
Guest User

Untitled

a guest
Jul 29th, 2020
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. # Import image to store
  2. path = self._url('/v2/images/%s/import' % image_id)
  3. headers = self._headers({
  4. 'content-type': 'application/json',
  5. 'X-Roles': 'admin',
  6. })
  7.  
  8. image_data_uri = 'http://localhost:%s/' % port
  9. data = jsonutils.dumps({'method': {
  10. 'name': 'web-download',
  11. 'uri': image_data_uri
  12. }})
  13. response = requests.post(path, headers=headers, data=data)
  14. self.assertEqual(http.ACCEPTED, response.status_code)
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement