<s> from __future__ import with_statement <EOL> from smugpy import SmugMug , SmugMugException <EOL> from . import smugpy <EOL> import sys <EOL> import unittest <EOL> API_KEY = '<STR_LIT>' <EOL> OAUTH_SECRET = '<STR_LIT>' <EOL> class TestOauth ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . smugmug = SmugMug ( api_key = API_KEY , api_version = '<STR_LIT>' , app_name = '<STR_LIT>' , oauth_secret = OAUTH_SECRET ) <EOL> def test_get_request_token ( self ) : <EOL> self . smugmug . auth_getRequestToken ( ) <EOL> self . assertNotEqual ( self . smugmug . oauth_token , None ) <EOL> self . assertNotEqual ( self . smugmug . oauth_token_secret , None ) <EOL> self . smugmug . reset_auth ( ) <EOL> def test_get_access_token ( self ) : <EOL> self . smugmug . auth_getAccessToken ( ) <EOL> self . assertNotEqual ( self . smugmug . oauth_token , None ) <EOL> self . assertNotEqual ( self . smugmug . oauth_token_secret , None ) <EOL> self . smugmug . reset_auth ( ) <EOL> def test_request_signature ( self ) : <EOL> url = '<STR_LIT>' <EOL> parameters = dict ( <EOL> method = '<STR_LIT>' , <EOL> NickName = '<STR_LIT>' <EOL> ) <EOL> timestamp = <NUM_LIT> <EOL> nonce = '<STR_LIT>' <EOL> signed_args = self . smugmug . _get_oauth_request_params ( url = url , parameters = parameters , method = '<STR_LIT:POST>' , timestamp = timestamp , nonce = nonce ) <EOL> self . assertEqual ( signed_args [ '<STR_LIT>' ] , '<STR_LIT>' ) </s>
