Skip to content

Add import command: restore cache contents from pickle format portable file - #8

Open
shubham-dce wants to merge 1 commit into
cli-07-exportfrom
cli-08-import
Open

Add import command: restore cache contents from pickle format portable file#8
shubham-dce wants to merge 1 commit into
cli-07-exportfrom
cli-08-import

Conversation

@shubham-dce

Copy link
Copy Markdown
Owner

Summary

Adds import FILE. Restores the cache contents from a portable pickle file.

Command added

  • import FILE - accepts a valid file path and writes the live cache from the file for the matching keys.

Notes

  • Read handles two erros explicitly - 1. OSError for missing file, permissions or invalid path. 2. pickle.UnpickingError for a corrupted or wrong file format.
  • Confirms the write using a prompt upfront unless -y/--yes flag passed with the command, as it writes into live cache data.
  • Explicit time handling as it returns the count of the written cache items before timeout error occurred.

Testing

  • 6 new tests are added. All tests are passing successfully. Test coverage is at 98.33%

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.

2 participants