Commit Graph

2 Commits

Author SHA1 Message Date
Claude
59cdf5ee01 refactor: Rename package from wikijs-python-sdk to py-wikijs and migrate to GitHub
Complete package renaming and platform migration:

Package Name Changes:
- Rename package from 'wikijs-python-sdk' to 'py-wikijs'
- Update setup.py package name
- Update pyproject.toml package name
- Users can now install with: pip install py-wikijs

URL Migration (Gitea → GitHub):
- Replace all Gitea URLs with GitHub URLs
- Update repository: github.com/l3ocho/py-wikijs
- Update issue tracker: github.com/l3ocho/py-wikijs/issues
- Update documentation links
- Fix URL path format (/src/branch/main/ → /blob/main/)

Documentation Updates:
- Update README.md badges (PyPI, GitHub)
- Update installation instructions (pip install py-wikijs)
- Update all doc references to new package name
- Update all examples with GitHub URLs
- Update DEPLOYMENT_READY.md with new package name
- Update deployment.md with new package name

Testing:
- Successfully built py_wikijs-0.1.0.tar.gz (138 KB)
- Successfully built py_wikijs-0.1.0-py3-none-any.whl (66 KB)
- Package installs correctly: pip install py-wikijs
- Imports work: from wikijs import WikiJSClient
- Package metadata correct (Home-page: github.com/l3ocho/py-wikijs)

Breaking Changes:
- Package name changed from wikijs-python-sdk to py-wikijs
- Repository migrated from Gitea to GitHub
- All URLs updated to GitHub

Users should now:
pip install py-wikijs  # Instead of wikijs-python-sdk

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-23 20:23:50 +00:00
Claude
0fa290d67b Add comprehensive async tests - all 37 tests passing
Phase 2, Task 2.1, Step 4 Complete: Async Testing Suite

This commit adds a complete test suite for the async client and
async pages endpoint, achieving 100% pass rate for async functionality.

Test Coverage:
--------------

1. **AsyncWikiJSClient Tests** (test_async_client.py)
   - Initialization tests (5 tests)
     * API key string initialization
     * Auth handler initialization
     * Invalid auth parameter handling
     * Custom settings configuration
     * Pages endpoint availability

   - HTTP Request tests (5 tests)
     * Successful API requests
     * 401 authentication errors
     * API error handling (500 errors)
     * Connection error handling
     * Timeout error handling

   - Connection Testing (4 tests)
     * Successful connection test
     * GraphQL error handling
     * Invalid response format detection
     * Missing configuration detection

   - Context Manager tests (2 tests)
     * Async context manager protocol
     * Manual close handling

   - Session Creation tests (3 tests)
     * Session creation and configuration
     * Lazy session initialization
     * Session reuse

2. **AsyncPagesEndpoint Tests** (test_async_pages.py)
   - Initialization test
   - List operations (3 tests)
     * Basic listing
     * Parameterized filtering
     * Validation errors

   - Get operations (3 tests)
     * Get by ID
     * Validation errors
     * Not found handling

   - Get by path operation
   - Create operations (2 tests)
     * Successful creation
     * Failed creation handling

   - Update operation
   - Delete operations (2 tests)
     * Successful deletion
     * Failed deletion handling

   - Search operation
   - Get by tags operation
   - GraphQL error handling
   - Data normalization tests (2 tests)

Bug Fixes:
----------
- Fixed exception handling order in AsyncWikiJSClient._request()
  * ServerTimeoutError now caught before ClientConnectionError
  * Prevents timeout errors being misclassified as connection errors

- Fixed test mocking for async context managers
  * Properly mock __aenter__ and __aexit__ methods
  * Fixed session creation in async context

Test Results:
-------------
 37/37 tests passing (100% pass rate)
 Async client tests: 19/19 passing
 Async pages tests: 18/18 passing
 53% overall code coverage (includes async code)
 Zero flake8 errors
 All imports successful

Quality Metrics:
----------------
- Test coverage for async module: >85%
- All edge cases covered (errors, validation, not found)
- Proper async/await usage throughout
- Mock objects properly configured
- Clean test structure and organization

Next Steps:
-----------
- Create async usage examples
- Write async documentation
- Performance benchmarks (async vs sync)
- Integration tests with real Wiki.js instance

This establishes a solid foundation for async development
with comprehensive test coverage ensuring reliability.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-22 18:12:29 +00:00