Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions tests/test_organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,32 @@ def test_update_organization_by_external_id(self):
self.assertEqual(response[0].organization.metadata, metadata)
self.assertEqual(response[0].organization.external_id, external_id)

def test_create_organization_with_slug(self):
""" Method to test create organization with slug """
import time
slug = f"test-slug-{int(time.time() * 1000)}"
display_name = Faker().company()
organization = CreateOrganization(display_name=display_name, slug=slug)
response = self.scalekit_client.organization.create_organization(organization=organization)
self.assertEqual(response[1].code().name, "OK")
self.assertEqual(response[0].organization.slug, slug)
self.org_id = response[0].organization.id

def test_update_organization_with_slug(self):
""" Method to test update organization with slug """
import time
organization = CreateOrganization(display_name=Faker().company(), external_id=Faker().uuid4())
org_response = self.scalekit_client.organization.create_organization(organization=organization)
self.org_id = org_response[0].organization.id

slug = f"upd-slug-{int(time.time() * 1000)}"
update_organization = UpdateOrganization(slug=slug)
response = self.scalekit_client.organization.update_organization(
organization_id=self.org_id, organization=update_organization
)
self.assertEqual(response[1].code().name, "OK")
self.assertEqual(response[0].organization.slug, slug)

def test_delete_organization(self):
""" Method to test delete organization """
organization = CreateOrganization(display_name=Faker().company(), external_id=Faker().uuid4())
Expand Down
Loading