casdoor / casdoor-python-sdk

Python client SDK for Casdoor
https://pypi.org/project/casdoor
Apache License 2.0
34 stars 36 forks source link

TypeError: __init__() got an unexpected keyword argument 'jwt_secret' #22

Closed cs1137195420 closed 2 years ago

cs1137195420 commented 2 years ago

When I try to run pytest for test_oauth.TestOAuth, I got the TypeError. Does jwt_secret need to be changed to certificate or other fields?

Here is my log:

============================= test session starts =============================
platform win32 -- Python 3.7.7, pytest-7.1.2, pluggy-1.0.0
cachedir: .pytest_cache
collecting ... collected 5 items

test_oauth.py::TestOAuth::test_get_oauth_token FAILED                    [ 20%]
src\tests\test_oauth.py:41 (TestOAuth.test_get_oauth_token)
self = <tests.test_oauth.TestOAuth testMethod=test_get_oauth_token>

    def test_get_oauth_token(self):
>       sdk = self.get_sdk()

test_oauth.py:43: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    @staticmethod
    def get_sdk():

        sdk = CasdoorSDK(
            endpoint="http://test.casbin.com:8000",
            client_id="3267f876b11e7d1cb217",
            client_secret="3f0d1f06d28d65309c8f38b505cb9dcfa487754d",
            jwt_secret="CasdoorSecret",
>           org_name="built-in",
        )
E       TypeError: __init__() got an unexpected keyword argument 'jwt_secret'

test_oauth.py:38: TypeError
FAILED                           [ 40%]
src\tests\test_oauth.py:57 (TestOAuth.test_get_user)
self = <tests.test_oauth.TestOAuth testMethod=test_get_user>

    def test_get_user(self):
>       sdk = self.get_sdk()

test_oauth.py:59: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    @staticmethod
    def get_sdk():

        sdk = CasdoorSDK(
            endpoint="http://test.casbin.com:8000",
            client_id="3267f876b11e7d1cb217",
            client_secret="3f0d1f06d28d65309c8f38b505cb9dcfa487754d",
            jwt_secret="CasdoorSecret",
>           org_name="built-in",
        )
E       TypeError: __init__() got an unexpected keyword argument 'jwt_secret'

test_oauth.py:38: TypeError
FAILED                          [ 60%]
src\tests\test_oauth.py:52 (TestOAuth.test_get_users)
self = <tests.test_oauth.TestOAuth testMethod=test_get_users>

    def test_get_users(self):
>       sdk = self.get_sdk()

test_oauth.py:54: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    @staticmethod
    def get_sdk():

        sdk = CasdoorSDK(
            endpoint="http://test.casbin.com:8000",
            client_id="3267f876b11e7d1cb217",
            client_secret="3f0d1f06d28d65309c8f38b505cb9dcfa487754d",
            jwt_secret="CasdoorSecret",
>           org_name="built-in",
        )
E       TypeError: __init__() got an unexpected keyword argument 'jwt_secret'

test_oauth.py:38: TypeError
FAILED                        [ 80%]
src\tests\test_oauth.py:62 (TestOAuth.test_modify_user)
self = <tests.test_oauth.TestOAuth testMethod=test_modify_user>

    def test_modify_user(self):
>       sdk = self.get_sdk()

test_oauth.py:64: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    @staticmethod
    def get_sdk():

        sdk = CasdoorSDK(
            endpoint="http://test.casbin.com:8000",
            client_id="3267f876b11e7d1cb217",
            client_secret="3f0d1f06d28d65309c8f38b505cb9dcfa487754d",
            jwt_secret="CasdoorSecret",
>           org_name="built-in",
        )
E       TypeError: __init__() got an unexpected keyword argument 'jwt_secret'

test_oauth.py:38: TypeError
FAILED                    [100%]
src\tests\test_oauth.py:46 (TestOAuth.test_parse_jwt_token)
self = <tests.test_oauth.TestOAuth testMethod=test_parse_jwt_token>

    def test_parse_jwt_token(self):
>       sdk = self.get_sdk()

test_oauth.py:48: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    @staticmethod
    def get_sdk():

        sdk = CasdoorSDK(
            endpoint="http://test.casbin.com:8000",
            client_id="3267f876b11e7d1cb217",
            client_secret="3f0d1f06d28d65309c8f38b505cb9dcfa487754d",
            jwt_secret="CasdoorSecret",
>           org_name="built-in",
        )
E       TypeError: __init__() got an unexpected keyword argument 'jwt_secret'

test_oauth.py:38: TypeError

Assertion failed

Assertion failed

Assertion failed

test_oauth.py::TestOAuth::test_get_user 
test_oauth.py::TestOAuth::test_get_users 
test_oauth.py::TestOAuth::test_modify_user 
test_oauth.py::TestOAuth::test_parse_jwt_token 

================================== FAILURES ===================================
_______________________ TestOAuth.test_get_oauth_token ________________________

self = <tests.test_oauth.TestOAuth testMethod=test_get_oauth_token>

    def test_get_oauth_token(self):
>       sdk = self.get_sdk()

test_oauth.py:43: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    @staticmethod
    def get_sdk():

        sdk = CasdoorSDK(
            endpoint="http://test.casbin.com:8000",
            client_id="3267f876b11e7d1cb217",
            client_secret="3f0d1f06d28d65309c8f38b505cb9dcfa487754d",
            jwt_secret="CasdoorSecret",
>           org_name="built-in",
        )
E       TypeError: __init__() got an unexpected keyword argument 'jwt_secret'

test_oauth.py:38: TypeError
___________________________ TestOAuth.test_get_user ___________________________

self = <tests.test_oauth.TestOAuth testMethod=test_get_user>

    def test_get_user(self):
>       sdk = self.get_sdk()

test_oauth.py:59: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    @staticmethod
    def get_sdk():

        sdk = CasdoorSDK(
            endpoint="http://test.casbin.com:8000",
            client_id="3267f876b11e7d1cb217",
            client_secret="3f0d1f06d28d65309c8f38b505cb9dcfa487754d",
            jwt_secret="CasdoorSecret",
>           org_name="built-in",
        )
E       TypeError: __init__() got an unexpected keyword argument 'jwt_secret'

test_oauth.py:38: TypeError
__________________________ TestOAuth.test_get_users ___________________________

self = <tests.test_oauth.TestOAuth testMethod=test_get_users>

    def test_get_users(self):
>       sdk = self.get_sdk()

test_oauth.py:54: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    @staticmethod
    def get_sdk():

        sdk = CasdoorSDK(
            endpoint="http://test.casbin.com:8000",
            client_id="3267f876b11e7d1cb217",
            client_secret="3f0d1f06d28d65309c8f38b505cb9dcfa487754d",
            jwt_secret="CasdoorSecret",
>           org_name="built-in",
        )
E       TypeError: __init__() got an unexpected keyword argument 'jwt_secret'

test_oauth.py:38: TypeError
_________________________ TestOAuth.test_modify_user __________________________

self = <tests.test_oauth.TestOAuth testMethod=test_modify_user>

    def test_modify_user(self):
>       sdk = self.get_sdk()

test_oauth.py:64: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    @staticmethod
    def get_sdk():

        sdk = CasdoorSDK(
            endpoint="http://test.casbin.com:8000",
            client_id="3267f876b11e7d1cb217",
            client_secret="3f0d1f06d28d65309c8f38b505cb9dcfa487754d",
            jwt_secret="CasdoorSecret",
>           org_name="built-in",
        )
E       TypeError: __init__() got an unexpected keyword argument 'jwt_secret'

test_oauth.py:38: TypeError
_______________________ TestOAuth.test_parse_jwt_token ________________________

self = <tests.test_oauth.TestOAuth testMethod=test_parse_jwt_token>

    def test_parse_jwt_token(self):
>       sdk = self.get_sdk()

test_oauth.py:48: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    @staticmethod
    def get_sdk():

        sdk = CasdoorSDK(
            endpoint="http://test.casbin.com:8000",
            client_id="3267f876b11e7d1cb217",
            client_secret="3f0d1f06d28d65309c8f38b505cb9dcfa487754d",
            jwt_secret="CasdoorSecret",
>           org_name="built-in",
        )
E       TypeError: __init__() got an unexpected keyword argument 'jwt_secret'

test_oauth.py:38: TypeError
=========================== short test summary info ===========================
FAILED test_oauth.py::TestOAuth::test_get_oauth_token - TypeError: __init__()...
FAILED test_oauth.py::TestOAuth::test_get_user - TypeError: __init__() got an...
FAILED test_oauth.py::TestOAuth::test_get_users - TypeError: __init__() got a...
FAILED test_oauth.py::TestOAuth::test_modify_user - TypeError: __init__() got...
FAILED test_oauth.py::TestOAuth::test_parse_jwt_token - TypeError: __init__()...
============================== 5 failed in 0.25s ==============================

Process finished with exit code 0
github-actions[bot] commented 2 years ago

:tada: This issue has been resolved in version 1.1.5 :tada:

The release is available on:

Your semantic-release bot :package::rocket: