コード例 #1
0
ファイル: test_client.py プロジェクト: dirigeant/sparkler
 def setUp(self):
     c = Configuration()
     self.config = c.load_dict({
         "auth_endpoint_uri":"https://www.joshcom.net"
     })
     self.consumer = Consumer("my_key", "my_secret", 
         self.config)
コード例 #2
0
    def test_defaults(self):
        config = Configuration({"auth_mode": "openid"})
        self.assertEqual("https://sparkplatform.com/oauth2",
                         config.config["auth_endpoint_uri"])

        config = Configuration({"auth_mode": "spark_auth"})
        self.assertEqual("https://sparkapi.com/v1/session",
                         config.config["auth_endpoint_uri"])
コード例 #3
0
ファイル: test_transport.py プロジェクト: dirigeant/sparkler
 def setUp(self):
     c = Configuration()
     self.config = c.load_dict({
         "key":"client_key",
         "secret":"client_secret",
         "auth_mode":"oauth2",
         "auth_endpoint_uri":"https://developers.sparkplatform.com/oauth2?",
         "api_endpoint_uri": "https://sparkapi.com",
         "auth_callback_uri":"https://www.joshcom.net/callback"
     })
     self.request = transport.ApiRequest(self.config)
コード例 #4
0
ファイル: test_spark_auth.py プロジェクト: dirigeant/sparkler
 def test_init(self):
     self.consumer = client.Consumer("my_key", "my_secret")
     c = Configuration()
     self.config = c.load_dict({
         "key":"client_key",
         "secret":"client_secret",
         "auth_mode":"spark_auth",
         "auth_endpoint_uri":"https://developers.sparkapi.com/v1/session",
         "api_endpoint_uri": "https://sparkapi.com"
     })
     self.assertRaises(RuntimeError, spark_auth.SparkAuthClient, self.consumer, self.config)
コード例 #5
0
    def setUp(self):
        self.consumer = client.Consumer("my_key", "my_secret", 
                "https://www.joshcom.net")
        self.token = oauth2.OAuth2Token.parse(TestOauth2Token.example_token())
        c = Configuration()
        self.config = c.load_dict({
            "key":"client_key",
            "secret":"client_secret",
            "auth_mode":"oauth2",
            "auth_endpoint_uri":"https://developers.sparkplatform.com/oauth2?",
            "api_endpoint_uri": "https://sparkapi.com",
            "auth_callback_uri":"https://www.joshcom.net/callback"
        })

        self.client = oauth2.OAuth2Client(self.consumer,self.config)
コード例 #6
0
ファイル: test_factory.py プロジェクト: dirigeant/sparkler
 def setUp(self):
     c = Configuration()
     self.config = c.load_dict({
         "key":
         "client_key",
         "secret":
         "client_secret",
         "auth_mode":
         "oauth2",
         "auth_endpoint_uri":
         "https://www.joshcom.net",
         "api_endpoint_uri":
         "https://sparkapi.com",
         "auth_callback_uri":
         "https://www.joshcom.net/callback"
     })
コード例 #7
0
 def setUp(self):
     c = Configuration()
     self.config = c.load_dict({
         "key":
         "client_key",
         "secret":
         "client_secret",
         "auth_mode":
         "oauth2",
         "auth_endpoint_uri":
         "https://developers.sparkplatform.com/oauth2?",
         "api_endpoint_uri":
         "https://sparkapi.com",
         "auth_callback_uri":
         "https://www.joshcom.net/callback"
     })
     self.request = transport.ApiRequest(self.config)
コード例 #8
0
 def test_load_dict(self):
     config = Configuration()
     c = config.load_dict({"auth_mode":"spark_auth"})
     self.assertEqual("spark_auth", c["auth_mode"])
コード例 #9
0
ファイル: client.py プロジェクト: dirigeant/sparkler
 def __init__(self, options_dict={}):
     # TODO: Reconfigre on the fly
     c = Configuration(options_dict)
     self.auth = AuthFactory.create(c.config)
     self.request = ApiRequest(c.config, self.auth)
コード例 #10
0
 def test_load_dict(self):
     config = Configuration()
     c = config.load_dict({"auth_mode": "spark_auth"})
     self.assertEqual("spark_auth", c["auth_mode"])
コード例 #11
0
 def test_initial_set_to_defaults(self):
     config = Configuration()
     self.assertEqual("hybrid", config.config["auth_mode"])
コード例 #12
0
ファイル: test_client.py プロジェクト: dirigeant/sparkler
 def setUp(self):
     c = Configuration()
     self.config = c.load_dict(
         {"auth_endpoint_uri": "https://www.joshcom.net"})
     self.consumer = Consumer("my_key", "my_secret", self.config)