コード例 #1
0
 def test_removes_expired_cookies_from_session_obj(self, initial_cookie,
                                                   expired_cookie, httpbin,
                                                   mock_env):
     session = Session(self.config_dir,
                       env=mock_env,
                       session_id=None,
                       bound_host=None)
     session['cookies'] = initial_cookie
     session.remove_cookies([expired_cookie])
     assert expired_cookie not in session.cookies
コード例 #2
0
def open_session(path: Path,
                 env: Environment,
                 read_only: bool = False) -> Iterator[Session]:
    session = Session(path, env, session_id='test', bound_host=DUMMY_HOST)
    session.load()
    yield session
    if not read_only:
        session.save()
コード例 #3
0
ファイル: test_sessions.py プロジェクト: devilkun/httpie
 def test_removes_expired_cookies_from_session_obj(self, initial_cookie,
                                                   expired_cookie, httpbin):
     session = Session(self.config_dir)
     session['cookies'] = initial_cookie
     session.remove_cookies([expired_cookie])
     assert expired_cookie not in session.cookies