Skip to content

Commit

Permalink
Merge pull request #2 from xiao-kong-long/test
Browse files Browse the repository at this point in the history
yes
  • Loading branch information
xiao-kong-long authored Nov 30, 2023
2 parents 9d65651 + 3c60853 commit b4a8f8d
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 10 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,7 @@ dmypy.json
.pyre/

.idea
.pytest_cache
.pytest_cache

# Vscode
.vscode
6 changes: 4 additions & 2 deletions src/tests/test_application.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
TestClientSecret,
TestEndpoint,
TestJwtPublicKey,
TestOrg,
TestOrganization,
get_random_name,
)

Expand All @@ -44,7 +44,9 @@ def test_application(self):
organization="casbin",
)

sdk = CasdoorSDK(TestEndpoint, TestClientId, TestClientSecret, TestJwtPublicKey, TestOrg, TestApplication)
sdk = CasdoorSDK(
TestEndpoint, TestClientId, TestClientSecret, TestJwtPublicKey, TestOrganization, TestApplication
)
try:
sdk.add_application(application=application)
except Exception as e:
Expand Down
8 changes: 5 additions & 3 deletions src/tests/test_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,21 @@
TestClientSecret,
TestEndpoint,
TestJwtPublicKey,
TestOrg,
TestOrganization,
get_random_name,
)


class TestGroup(unittest.TestCase):
class GroupTest(unittest.TestCase):
def test_group(self):
name = get_random_name("group")

# Add a new object
group = Group.new(owner="admin", name=name, created_time=datetime.datetime.now().isoformat(), display_name=name)

sdk = CasdoorSDK(TestEndpoint, TestClientId, TestClientSecret, TestJwtPublicKey, TestOrg, TestApplication)
sdk = CasdoorSDK(
TestEndpoint, TestClientId, TestClientSecret, TestJwtPublicKey, TestOrganization, TestApplication
)

try:
sdk.add_group(group)
Expand Down
8 changes: 5 additions & 3 deletions src/tests/test_organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
TestClientSecret,
TestEndpoint,
TestJwtPublicKey,
TestOrg,
TestOrganization,
get_random_name,
)


class TestOrganization(unittest.TestCase):
class OrganizationTest(unittest.TestCase):
def test_organization(self):
name = get_random_name("Organization")

Expand All @@ -49,7 +49,9 @@ def test_organization(self):
is_profile_public=False,
)

sdk = CasdoorSDK(TestEndpoint, TestClientId, TestClientSecret, TestJwtPublicKey, TestOrg, TestApplication)
sdk = CasdoorSDK(
TestEndpoint, TestClientId, TestClientSecret, TestJwtPublicKey, TestOrganization, TestApplication
)

try:
sdk.add_organization(organization)
Expand Down
2 changes: 1 addition & 1 deletion src/tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
TestEndpoint = "https://demo.casdoor.com"
TestClientId = "294b09fbc17f95daf2fe"
TestClientSecret = "dd8982f7046ccba1bbd7851d5c1ece4e52bf039d"
TestOrg = "casbin"
TestOrganization = "casbin"
TestApplication = "app-vue-python-example"
TestJwtPublicKey = """-----BEGIN CERTIFICATE-----
MIIE+TCCAuGgAwIBAgIDAeJAMA0GCSqGSIb3DQEBCwUAMDYxHTAbBgNVBAoTFENh
Expand Down

0 comments on commit b4a8f8d

Please sign in to comment.