Skip to content
This repository was archived by the owner on Jul 16, 2025. It is now read-only.

Conversation

@seer-by-sentry
Copy link

This PR adds tests for #528

Commits:

  • Add unit tests for network_upload command

…ommands/` directory. The file contains unit tests for the `network_upload` command introduced in the diff. Here's a breakdown of the tests:

1. We import necessary modules and mock the `NetworkFinder` and `UploadSender` classes.
2. We create test fixtures for these mocked classes to be used across multiple tests.
3. We implement four test functions:
   a. `test_network_upload_dry_run`: Tests the dry run functionality.
   b. `test_network_upload_no_files_found`: Tests the behavior when no files are found.
   c. `test_network_upload_success`: Tests a successful upload scenario.
   d. `test_network_upload_failure`: Tests a failed upload scenario.

These tests cover various aspects of the `network_upload` command, including its options, dry run behavior, file finding, and both successful and failed upload processes. We use the `click.testing.CliRunner` to simulate command invocations and assert the expected outputs and behaviors.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants