Skip to content

test: cover DynamoDB table provisioning schema - #315

Merged
codeforstartups merged 1 commit into
codeforstartups:developmentfrom
tikhandesanket:Sort-key_adjacency_design#29
Oct 2, 2026
Merged

codeforstartups merged 1 commit into
codeforstartups:developmentfrom
tikhandesanket:Sort-key_adjacency_design#29

Conversation

@tikhandesanket

Copy link
Copy Markdown
Collaborator

Description

Add test coverage for DynamoDB table provisioning to verify that ensure_table() creates the expected key schema.

Related issue

Fixes #

Changes

  • Added a provisioning test using Moto DynamoDB.
  • Verified the table uses pk as the HASH/partition key.
  • Verified pk is defined as a DynamoDB String (S).
  • No production code changes.

Testing

  • Tests pass locally
  • Ruff checks pass
  • Documentation updated, if applicable

Checklist

  • My changes are focused and relevant to this pull request.
  • I have added or updated tests where appropriate.
  • I have reviewed my changes for unrelated modifications.
  • I have updated documentation where necessary.

@Kaap10 Kaap10 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the contribution, @tikhandesanket! Great to see test coverage added for ensure_table().
The test is clean and correctly validates the table's KeySchema and AttributeDefinitions using Moto.

A couple of minor suggestions:

  • Idempotency: ensure_table() is designed to be idempotent (handling ResourceInUseException). Calling ensure_table(config, session) a second time in the test would help verify this contract.
  • Convention: Please add from __future__ import annotations at the top of the file to align with the rest of the codebase.

LGTM!

@codeforstartups

Copy link
Copy Markdown
Owner

Clean, focused test — verifies ensure_table provisions the pk HASH key schema and attribute definitions via moto. Good provisioning-regression coverage. All 4 checks green. Merging — thanks @tikhandesanket!

@codeforstartups
codeforstartups merged commit 81c7dbb into codeforstartups:development Oct 2, 2026
4 checks passed
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.

3 participants