mirror of
https://github.com/httpie/cli.git
synced 2025-06-30 22:30:46 +02:00
added a test for expiring cookies
This commit is contained in:
@ -2,6 +2,7 @@
|
|||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import sys
|
import sys
|
||||||
|
import json
|
||||||
from tempfile import gettempdir
|
from tempfile import gettempdir
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
@ -186,3 +187,13 @@ class TestSession(SessionTestBase):
|
|||||||
httpbin.url + '/get', env=self.env())
|
httpbin.url + '/get', env=self.env())
|
||||||
finally:
|
finally:
|
||||||
os.chdir(cwd)
|
os.chdir(cwd)
|
||||||
|
|
||||||
|
def test_expired_cookies(self, httpbin):
|
||||||
|
self.start_session(httpbin)
|
||||||
|
session_path = self.config_dir / 'session-by-path.json'
|
||||||
|
http('--session', str(session_path), httpbin.url + '/cookies/set?hello=100')
|
||||||
|
r1 = http('--session', str(session_path), httpbin.url + '/cookies/delete?hello=100')
|
||||||
|
with open(self.config_dir / 'session-by-path.json', 'r') as myfile:
|
||||||
|
data=myfile.read()
|
||||||
|
obj = json.loads(data)
|
||||||
|
assert len(obj['cookies']) == 0
|
Reference in New Issue
Block a user