Package scapi :: Package tests :: Module test_oauth
[hide private]
[frames] | no frames]

Source Code for Module scapi.tests.test_oauth

 1  import pkg_resources 
 2  import scapi 
 3  import scapi.authentication 
 4  import urllib 
 5  import logging 
 6   
 7  logger = logging.getLogger(__name__) 
 8  logger.setLevel(logging.DEBUG) 
 9  _logger = logging.getLogger("scapi") 
10  _logger.setLevel(logging.DEBUG) 
11   
12  TOKEN  = "QcciYu1FSwDSGKAG2mNw" 
13  SECRET = "gJ2ok6ULUsYQB3rsBmpHCRHoFCAPOgK8ZjoIyxzris" 
14  CONSUMER = "Cy2eLPrIMp4vOxjz9icdQ" 
15  CONSUMER_SECRET = "KsBa272x6M2to00Vo5FdvZXt9kakcX7CDIPJoGwTro" 
16   
17 -def test_base64_connect():
18 scapi.USE_PROXY = True 19 scapi.PROXY = 'http://127.0.0.1:10000/' 20 scapi.SoundCloudAPI(host='192.168.2.31:3000', authenticator=scapi.authentication.BasicAuthenticator('tiga', 'test')) 21 sca = scapi.Scope() 22 assert isinstance(sca.me(), scapi.User)
23 24
25 -def test_oauth_connect():
26 scapi.USE_PROXY = True 27 scapi.PROXY = 'http://127.0.0.1:10000/' 28 scapi.SoundCloudAPI(host='192.168.2.31:3000', 29 authenticator=scapi.authentication.OAuthAuthenticator(CONSUMER, 30 CONSUMER_SECRET, 31 TOKEN, SECRET)) 32 33 sca = scapi.Scope() 34 assert isinstance(sca.me(), scapi.User)
35