Skip to content

Add test for header parts containing "realm" #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions tests/test_oauth.py
Original file line number Diff line number Diff line change
@@ -889,6 +889,27 @@ def test_from_request(self):
req = oauth.Request.from_request("GET", url)
self.assertEquals(None, req)

def test_from_request_with_realm(self):
url = "http://sp.example.com/"

params = {
'oauth_version': "1.0",
'oauth_nonce': "4572616e48616d6d65724c61686176",
'oauth_timestamp': "137131200",
'oauth_consumer_key': "0685bd9184jfhq22",
'oauth_signature_method': "HMAC-SHA1",
'oauth_token': "ad180jjd733klru7",
'oauth_signature': "wOJIO9A2W5mFwDgiDvZbTSMK%2Frealm", # Signature contains "realm"
}

req = oauth.Request("GET", url, params)
headers = req.to_header()

# Test that oauth_signature was not removed from headers
req = oauth.Request.from_request("GET", url, headers)
self.assertEquals(req.method, "GET")
self.assertIsNotNone(req.get("oauth_signature"))

def test_from_token_and_callback(self):
url = "http://sp.example.com/"