Skip to content

Commit

Permalink
FIX Cookie cases-upload
Browse files Browse the repository at this point in the history
  • Loading branch information
JkhatriInfobox committed Nov 15, 2024
1 parent 68f880e commit d07aa2d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/test_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,12 @@ def test_call_upload_file(self):
payload = dict(file=data)
with patch.object(requests.Session, 'post',
return_value=mock.Mock()) as patched_post:
self.connector.session.cookies = ['cookies']
cookie_jar = RequestsCookieJar()
cookie_jar.set(
'ibapauth',
'ctime={},user=admin,group=admin-group,auth=LOCAL,client=API,mtime=1731651582,su=1,ip=localhost,timeout=60,mjuHjy8l1tY0GhSf+aRcxI7rybaIONUIpjc'.format(
int(time.time())), domain='infoblox.localhost')
self.connector.session.cookies = cookie_jar
patched_post.return_value.status_code = 200
patched_post.return_value.content = '{}'
self.connector.upload_file(upload_url, payload)
Expand Down

0 comments on commit d07aa2d

Please sign in to comment.