Skip to content

Commit

Permalink
Update test response with correct cookie handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Terrance committed May 22, 2020
1 parent 764b2f5 commit 8e62dda
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -6,7 +6,7 @@
long_description=open(path.join(path.abspath(path.dirname(__file__)), "README.rst"), "r").read(),
packages=["skpy"],
install_requires=["beautifulsoup4", "requests"],
tests_require=["beautifulsoup4", "requests", "responses"],
tests_require=["beautifulsoup4", "requests", "responses>0.10.8", "urllib3"],
classifiers=["Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Topic :: Communications :: Chat",
Expand Down
5 changes: 4 additions & 1 deletion test/client.py
Expand Up @@ -5,6 +5,8 @@
import re
import unittest

from urllib3.connection import HTTPHeaderDict

import responses

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

0 comments on commit 8e62dda

Please sign in to comment.