Commit Graph
31 Commits
Author SHA1 Message Date
xixu-me 148b3b3780 ci: add Python 3.14 support 2026-04-11 21:20:53 +08:00
xixu-me 8e5e1e3271 Format coverage gap tests for CI 2026-03-20 12:52:53 +08:00
xixu-me a2ef8dd115 Add targeted coverage gap tests 2026-03-20 12:47:14 +08:00
xixu-me a3350b1a27 Fix macOS CI path assertions for JSON output 2026-03-17 17:00:56 +08:00
xixu-me 0c52a51a15 Add machine-readable CLI output for desktop clients 2026-03-17 16:29:09 +08:00
xixu-me 5ecb10411f Update compression level error message in test
Adjusted the expected error message in the test for invalid compression level to match the new format, specifying that the value must be an integer between 1 and 22.
2025-10-04 20:36:23 +08:00
xixu-me 2cb2b9eaa7 Fix regex in compression level validation test
Updated the regex pattern in the compression level validation test to escape the dot character, ensuring correct matching of invalid input '1.5'.
2025-10-03 22:05:22 +08:00
xixu-me cb5c198d16 Refactor tests and enhance coverage for conflict resolution and edge cases
- Removed outdated tests for missing lines in core.py.
- Added comprehensive tests for conflict resolution functionality, including various resolution strategies and edge cases.
- Improved error handling tests for archive creation and extraction processes.
- Enhanced unit tests for basic functionality and convenience functions with pytest markers.
- Introduced tests for unique filename generation and conflict handling scenarios.
- Added edge case tests for archive extraction and error conditions to improve overall test coverage.
2025-06-04 18:55:53 +08:00
xixu-me 654d9f1666 Improve cleanup and exception handling in tests
Enhanced cleanup logic in `temp_dir` fixture to handle Windows-specific file locking issues. Updated tests to ensure suppressed exceptions during context manager exit and added manual cleanup for mocked objects to prevent resource leaks.
2025-06-02 20:23:09 +08:00
xixu-me 172ec6cb29 Add validation for invalid commands in CLI
Introduced `_validate_command_in_argv` to check for invalid commands in CLI arguments. Updated compression level validation to include the new `-c` flag. Adjusted tests to reflect changes in error handling, ensuring argparse error codes are maintained for invalid inputs.
2025-06-02 20:11:15 +08:00
xixu-me 94b7a5b31a Add error handling and extractall method in TzstArchive
Enhanced the TzstArchive class with improved error handling for cleanup and file addition operations. Introduced a new extractall method with filtering options for secure extraction. Updated tests to reflect changes in extraction behavior and error handling.
2025-06-02 19:43:50 +08:00
xixu-me 1d98650d3b Refactor test cases for clarity and consistency
Updated test cases in `test_cli_missing_lines.py`, `test_core_missing_lines.py`, and `test_core_missing_lines_fixed.py` to improve readability and consistency. Changes include replacing redundant comments, simplifying code structure, and ensuring proper function usage (e.g., `_validate_files` instead of `validate_files`).
2025-06-02 17:09:03 +08:00
xixu-me 1cad021539 Add comprehensive test cases for CLI and core
Introduced new test files to improve coverage for CLI and core functionalities. Added edge case tests for CLI commands, conftest fixtures, and core archive handling, including error handling, streaming mode, and verbose listing.
2025-06-02 16:39:04 +08:00
xixu-me 0ecbdb3ea0 Add tests for edge cases and coverage improvements
Introduced new test cases in `test_convenience_functions.py` and `test_security_and_errors.py` to cover edge cases, improve code coverage, and validate specific scenarios such as invalid modes, compression levels, and operations on closed archives. These changes address missing lines from the coverage report and enhance robustness.
2025-06-02 07:54:27 +08:00
xixu-me a4ddd106f8 Add comprehensive CLI test coverage
Introduced new test cases for CLI commands to cover verbose and simple listing functionalities, exception handling, and edge cases. This includes tests for missing files, decompression errors, keyboard interrupts, and advanced scenarios to ensure robust behavior.
2025-06-02 07:14:17 +08:00
xixu-me 4e0ec638cc Add handling for extreme compression levels
Introduced `_is_extreme_compression_level_in_argv` to detect extreme compression levels (>=1000) and updated `_handle_parsing_errors` to return exit code 1 for such cases. Adjusted related tests to validate the new behavior and fixed inconsistencies in test assertions for compression level and filter validation.
2025-06-02 06:29:33 +08:00
xixu-me da2baa46c5 Add integration and unit tests for tzst library functionality
- Created integration tests for complex scenarios in `tests/integration/test_complex_scenarios.py`.
- Added unit tests for core functionality, convenience functions, security features, and error handling in `tests/unit/test_archive_basics.py`, `tests/unit/test_convenience_functions.py`, `tests/unit/test_security_and_errors.py`.
- Implemented tests for temporary file exclusion, large file operations, and complex directory structures.
- Included tests for atomic operations and compression level validation.
- Established a structure for integration and unit tests with appropriate docstrings and assertions.
2025-06-02 05:40:42 +08:00
xixu-me 17c530ef21 Fix current directory archiving logic
Updated `_create_archive_impl` to handle current directory archiving more robustly, including resolving paths, excluding temporary files, and ensuring the archive file itself is excluded. Added comprehensive tests to verify behavior for edge cases and temporary file exclusion patterns.
2025-06-01 23:19:09 +08:00
xixu-me d2095bb7b4 Fix path in no_atomic extraction test
Updated the test to correctly reference the extracted file path in the 'test_no_atomic_extracted' scenario, ensuring the test checks the correct file location.
2025-06-01 19:07:14 +08:00
xixu-me ec04f2935e Add tests for invalid compression levels
Introduced a new test case to verify that invalid compression levels return proper error codes. Minor formatting adjustments were also made to improve code readability.
2025-06-01 18:49:35 +08:00
xixu-me 22dc90259b Add version argument and update tests
Introduced a '--version' argument in the CLI to display version information. Updated test cases to reflect changes in compression level validation and error codes. Adjusted special character handling in test_core.py and added integration test markers in pyproject.toml.
2025-06-01 18:37:27 +08:00
xixu-me 459b695af0 Add compression level validation to CLI
Introduced a `validate_compression_level` function to ensure compression levels are within the valid range (1-22). Updated CLI argument parsing to use this validation and added tests to verify valid, invalid, and non-numeric compression levels.
2025-06-01 17:01:27 +08:00
xixu-me 2a3ccefb21 Refactor CLI tests to use unpacking for file lists
Updated test cases in `test_cli.py` and `test_platform_specific.py` to use argument unpacking (`*files`) for file lists passed to the `main` function. This improves readability and consistency across test cases.
2025-06-01 15:13:56 +08:00
xixu-me acd9ced29e Fixes critical path resolution bug and consolidates tests
Resolves a critical bug in non-atomic archive creation where relative
archive paths failed when the working directory changed during operation.
The fix converts archive paths to absolute before changing directories.

Consolidates duplicate CLI and security tests into comprehensive test
suites to eliminate redundancy and improve maintainability. Adds
extensive edge case coverage including platform-specific features,
Unicode handling, and performance scenarios.

Updates version to 1.0.1 and ensures proper exit code propagation
in the main entry point for better script integration.
2025-06-01 14:57:31 +08:00
xixu-me f2d8e6ad03 Refactor CLI command argument handling in tests
Updated test cases to use unpacking syntax (*file_paths) for passing file paths to CLI commands. This improves readability and ensures consistent argument handling across all test scenarios.
2025-06-01 00:37:25 +08:00
xixu-me c53637aaf7 Add strict mode to zip iteration in tests
Updated tests in `test_core.py` to use the `strict=True` parameter in `zip` for better error handling when iterating over buffered and streaming contents. This ensures mismatched lengths are caught during testing.
2025-05-31 15:53:56 +08:00
xixu-me 6b57409712 Update Python version support to 3.12+
This commit updates the CI configuration, pyproject.toml, and codebase to drop support for Python versions below 3.12 and add support for Python 3.13. Type hints are updated to use modern syntax, and redundant checks for extraction filter support are removed as Python 3.12+ always supports filters.
2025-05-31 15:48:13 +08:00
xixu-me 4e155d0e05 Refactor test argument order in CLI security tests
Reordered arguments in the test_filter_with_other_options method for better readability and consistency. This change improves clarity in the test setup.
2025-05-31 01:01:24 +08:00
xixu-me 4c4235ee87 Add security filters for archive extraction
Introduced security filters ('data', 'tar', 'fully_trusted') to enhance safety during archive extraction. Updated CLI commands, core extraction logic, and added comprehensive tests to ensure proper handling of filters and security warnings.
2025-05-31 00:12:39 +08:00
xixu-me 521a6858fb Add streaming mode and atomic operations
Introduced streaming mode for memory-efficient handling of large archives and added atomic file operations for reliable archive creation. Updated CLI commands, core functionality, and tests to support these features. Improved error handling and documentation for append mode and compression level validation.
2025-05-30 14:22:07 +08:00
xixu-me 6a3cdd48b8 Initial commit 2025-05-29 21:59:21 +08:00