Skip to content
This repository was archived by the owner on Jun 11, 2025. It is now read-only.

Commit 8e62dda

Browse files
committed
Update test response with correct cookie handling
1 parent 764b2f5 commit 8e62dda

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
long_description=open(path.join(path.abspath(path.dirname(__file__)), "README.rst"), "r").read(),
77
packages=["skpy"],
88
install_requires=["beautifulsoup4", "requests"],
9-
tests_require=["beautifulsoup4", "requests", "responses"],
9+
tests_require=["beautifulsoup4", "requests", "responses>0.10.8", "urllib3"],
1010
classifiers=["Development Status :: 4 - Beta",
1111
"Intended Audience :: Developers",
1212
"Topic :: Communications :: Chat",

test/client.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import re
66
import unittest
77

8+
from urllib3.connection import HTTPHeaderDict
9+
810
import responses
911

1012
from skpy import Skype, SkypeConnection, SkypeContact, SkypeMsg, SkypeTextMsg, SkypeUtils
@@ -47,7 +49,8 @@ def registerMocks(regTokenRedirect=False, guest=False):
4749
"""
4850
# Retrieve the login form.
4951
responses.add(responses.GET, "{0}/oauth/microsoft".format(SkypeConnection.API_LOGIN), status=200,
50-
adding_headers={"Set-Cookie": "MSPRequ=MSPRequ; MSPOK=MSPOK"}, content_type="text/html",
52+
adding_headers=HTTPHeaderDict((("Set-Cookie", "MSPRequ=MSPRequ"),
53+
("Set-Cookie", "MSPOK=MSPOK"))), content_type="text/html",
5154
body="""<html><body><input name="PPFT" value="ppftvalue"></body></html>""")
5255
# Submit username/password to form.
5356
responses.add(responses.POST, "{0}/ppsecure/post.srf".format(SkypeConnection.API_MSACC),

0 commit comments

Comments
 (0)