Skip to content

Conversation

@souvikchand
Copy link

🧪 added test cases for custom_components/spoolman/helpers/add_trailing.sh

  • created tests/ folder
  • wrote 4 test cases for add_trailing_slash() function
  • mocked the import of homeassistant
  • so I added tests/utils/load_module.py

🔗 Related Issue

🎨 Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📝 Documentation update
  • 🧹 Code refactoring (no functional changes)
  • ⚡ Performance improvement
  • ✅ Test update
  • 🔧 Configuration change
  • 🎨 UI/UX improvement

🧪 Testing

  • I have tested this code locally
  • I have added/updated unit tests that prove my fix/feature works
  • All existing tests pass locally
  • I have tested this in Home Assistant

Test Environment

  • Home Assistant version:
  • Python version: 3.10.0
  • Integration version:
  • Spoolman version: 1.2.1

Test Scenarios

  1. if input doesn't end with '/'
  2. if input ends with '/'
  3. if input is empty
  4. if input is '/'

✅ Checklist

  • 📖 My code follows the project's coding style
  • 🔍 I have performed a self-review of my code
  • 💬 I have commented my code, particularly in hard-to-understand areas
  • 📚 I have updated the documentation (README, CONTRIBUTING, etc.) if needed
  • ⚠️ My changes generate no new warnings or errors
  • 🧪 I have added tests that prove my fix is effective or that my feature works
  • ✅ New and existing unit tests pass locally with my changes
  • 🌿 I am merging into the dev branch (not main)
  • 📝 My commits follow the Conventional Commits specification
  • 🔄 I have updated the integration version in manifest.json if needed
  • 🌍 I have updated translations if I changed user-facing strings

📋 Commit Message Format

  • feat added test files for helper function

📝 Additional Notes

I Mocked importing home assistant because the function was a simple oneand not dependent on any module. I hope that's acceptable


For Maintainers

Review Checklist

  • Code quality is acceptable
  • Tests are adequate
  • Documentation is updated
  • Breaking changes are documented
  • Ready to merge to dev

Post-Merge Tasks

  • Update CHANGELOG if needed
  • Tag for release (if applicable)
  • Update documentation site (if applicable)

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Dec 12, 2025
@github-actions github-actions bot added Test needed size:M This PR changes 30-99 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Dec 12, 2025
@dosubot dosubot bot added Home Assistant Stuff that is related to home assistant and the integration of services python Pull requests that update Python code labels Dec 12, 2025
@souvikchand
Copy link
Author

@Disane87 please check this PR regarding #269

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

Labels

Home Assistant Stuff that is related to home assistant and the integration of services python Pull requests that update Python code size:M This PR changes 30-99 lines, ignoring generated files. Test needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant