Skip to content

Commit

Permalink
fix: run deployment pull type
Browse files Browse the repository at this point in the history
  • Loading branch information
Justintime50 committed Sep 1, 2023
1 parent c76e622 commit cc273e2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
3 changes: 3 additions & 0 deletions test/unit/repos/deployments.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ def test_store_deployment_details(mock_logger, mock_output, mock_webhook):
store_deployment_details(mock_webhook, mock_output)

mock_logger.assert_called()


# TODO: Dev database where we can retrieve deployments
16 changes: 11 additions & 5 deletions test/unit/test_deployments.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
def mock_config(deployment_type='deploy', prod_compose=False):
"""A mock configuration object similar to what would be stored in `harvey.yaml`."""
mock_config = {
'deployment': deployment_type,
'deployment_type': deployment_type,
'prod_compose': prod_compose,
'healthcheck': ['mock_container_name'],
}
Expand Down Expand Up @@ -101,13 +101,19 @@ def test_run_deployment_pull(
mock_path_exists,
mock_webhook,
):
"""Test the `pull` deployment_type. Pulls happen before getting to deployments, we don't expect a deployment
to have occured when pulling.
"""
_ = Deployment.run_deployment(mock_webhook)

mock_initialize_deployment.assert_called_once_with(mock_webhook)
mock_deploy_deployment.assert_called_once()
mock_client.assert_called_once()
mock_healthcheck.assert_called_once()
mock_utils_success.assert_called_once()
mock_deploy_deployment.assert_not_called()
mock_client.assert_not_called()
mock_healthcheck.assert_not_called()
mock_utils_success.assert_called_once_with(
'mock output\nHarvey pulled test_user/test-repo-name successfully. Success!\n',
ANY,
)


@patch('os.path.exists', return_value=True)
Expand Down

0 comments on commit cc273e2

Please sign in to comment.