Skip to content

feat(org): add slug integration tests#161

Closed
srinivaskarre-sk wants to merge 1 commit into
mainfrom
feat/org-slug-support
Closed

feat(org): add slug integration tests#161
srinivaskarre-sk wants to merge 1 commit into
mainfrom
feat/org-slug-support

Conversation

@srinivaskarre-sk
Copy link
Copy Markdown
Contributor

@srinivaskarre-sk srinivaskarre-sk commented May 18, 2026

Summary

  • slug is already present in the generated proto types (CreateOrganization, UpdateOrganization, Organization)
  • Add integration tests to verify slug round-trips correctly through create and update

Test plan

  • test_create_organization_with_slug — sets slug on CreateOrganization, asserts response[0].organization.slug matches
  • test_update_organization_with_slug — sets slug on UpdateOrganization, asserts updated value is returned

Run with staging credentials:

SCALEKIT_ENV_URL=... SCALEKIT_CLIENT_ID=... SCALEKIT_CLIENT_SECRET=... \
  pytest tests/test_organization.py::TestOrganization::test_create_organization_with_slug \
         tests/test_organization.py::TestOrganization::test_update_organization_with_slug -v

Summary by CodeRabbit

  • Tests
    • Added validation tests for organization slug functionality to ensure slug creation and updates work as expected.

Review Change Stack

- 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
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

Walkthrough

Two new test cases validate slug support in the organization API: one creates an organization with a unique slug and asserts the returned slug matches, the other creates an organization then updates its slug and verifies the change persists.

Changes

Organization slug validation tests

Layer / File(s) Summary
Slug creation and update tests
tests/test_organization.py
test_create_organization_with_slug creates an organization with a generated slug and asserts the slug is returned correctly. test_update_organization_with_slug creates an organization, updates its slug, and verifies the slug update succeeds.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • Avinash-Kamath

Poem

🐰 A slug that's unique, a path with delight,
Create it and update it, everything's right,
Test cases now dance in the organization's way,
Validation takes flight with each passing day! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(org): add slug integration tests' clearly and concisely describes the main change: adding integration tests for slug support in the organization API.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/org-slug-support

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
tests/test_organization.py (1)

119-119: ⚡ Quick win

Move the import statement to the module level.

The import time statement should be placed at the top of the file with other imports, following Python conventions (PEP 8). This applies to both test methods.

♻️ Proposed fix

Add time import at the top of the file (after line 3):

 from faker import Faker
+import time
 
 from basetest import BaseTest

Then remove the inline imports:

 def test_create_organization_with_slug(self):
     """ Method to test create organization with slug """
-    import time
     slug = f"test-slug-{int(time.time() * 1000)}"
 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())
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/test_organization.py` at line 119, The file has inline "import time"
statements inside test methods; move "import time" to the module-level imports
at the top of the file (with the other imports) and remove the inline imports
from the test functions (any functions named test_* in that file) so tests use
the top-level time import per PEP 8.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@tests/test_organization.py`:
- Line 119: The file has inline "import time" statements inside test methods;
move "import time" to the module-level imports at the top of the file (with the
other imports) and remove the inline imports from the test functions (any
functions named test_* in that file) so tests use the top-level time import per
PEP 8.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5805f09e-e62c-4d49-9e5a-266180ed5d3f

📥 Commits

Reviewing files that changed from the base of the PR and between dffa1c8 and 04e5d6b.

📒 Files selected for processing (1)
  • tests/test_organization.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant