Skip to content

Add IsNonCompressedTarball method to Compressor interface #128

Closed
mdzhigarov wants to merge 5 commits intocloudfoundry:developfrom
mdzhigarov:master
Closed

Add IsNonCompressedTarball method to Compressor interface #128
mdzhigarov wants to merge 5 commits intocloudfoundry:developfrom
mdzhigarov:master

Conversation

@mdzhigarov
Copy link
Contributor

This PR adds a new method IsNonCompressedTarball to the Compressor interface to detect whether a file is a non-compressed tarball.

Changes

  • Added IsNonCompressedTarball(path string) (bool, error) method to the Compressor interface
  • Implemented the method in tarballCompressor using the native golang approach to inspect the tar contents
  • Implemented the method in FakeCompressor returning false for testing purposes
  • Added comprehensive unit tests covering:
    • Positive case: non-compressed tarball files
    • Negative cases: compressed tarballs and non-tarball files
    • Error handling: file command failures and execution errors

Testing

All existing tests pass and new unit tests provide comprehensive coverage of the new functionality.

- Add IsNonCompressedTarball method to Compressor interface
- Implement IsNonCompressedTarball in tarballCompressor using 'file' command
- Implement IsNonCompressedTarball in FakeCompressor returning false
- Add comprehensive unit tests for IsNonCompressedTarball functionality
- Tests cover positive/negative cases, error handling, and edge cases
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