From 04e5d6bb2e209fd99249837e33276c0d960cfe0f Mon Sep 17 00:00:00 2001 From: Srinivas Karre Date: Mon, 18 May 2026 09:58:19 +0530 Subject: [PATCH] feat(org): add slug integration tests - test_create_organization_with_slug: verifies slug is set and returned on create - test_update_organization_with_slug: verifies slug can be updated via UpdateOrganization --- tests/test_organization.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/test_organization.py b/tests/test_organization.py index ea8711d..bd68409 100644 --- a/tests/test_organization.py +++ b/tests/test_organization.py @@ -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())