def test_deploy_conflict(): responses.add(responses.PUT, 'http://marathon.somedomain.com:8080/v2/apps/test-app', status=409, json=_load_json_fixture("deployment_in_progress")) client = MarathonClient("http://marathon.somedomain.com:8080") with pytest.raises(ClientError): client.deploy({"id": "test-app"})
def test_deploy_unprocessable_entity(): responses.add(responses.PUT, 'http://marathon.somedomain.com:8080/v2/apps/test-app', status=422, json=_load_json_fixture("validation_errors")) client = MarathonClient("http://marathon.somedomain.com:8080") with pytest.raises(ClientError): client.deploy({"id": "test-app"})
def test_deploy_unprocessable_entity(): responses.add( responses.PUT, "http://marathon.somedomain.com:8080/v2/apps/test-app", status=422, json=_load_json_fixture("validation_errors"), ) client = MarathonClient("http://marathon.somedomain.com:8080") with pytest.raises(ClientError): client.deploy({"id": "test-app"})
def test_deploy_conflict(): responses.add( responses.PUT, "http://marathon.somedomain.com:8080/v2/apps/test-app", status=409, json=_load_json_fixture("deployment_in_progress"), ) client = MarathonClient("http://marathon.somedomain.com:8080") with pytest.raises(ClientError): client.deploy({"id": "test-app"})
def test_deploy_multiple(mock_deployment_check): responses.add( responses.PUT, "http://marathon.somedomain.com:8080/v2/apps/", status=201, json=_load_json_fixture("deployment") ) mock_deployment_check.return_value = True client = MarathonClient("http://marathon.somedomain.com:8080") deployment = client.deploy([{"id": "test-app"}, {"id": "test-app-2"}]) assert deployment.wait(check_interval_secs=0.1)
def test_deploy_single_app_list(mock_deployment_check): responses.add(responses.PUT, 'http://marathon.somedomain.com:8080/v2/apps/test-app', status=201, json=_load_json_fixture("deployment")) mock_deployment_check.return_value = True client = MarathonClient("http://marathon.somedomain.com:8080") deployment = client.deploy([{"id": "test-app"}]) assert deployment.wait(check_interval_secs=0.1)
def test_deploy_dry_run(): client = MarathonClient("http://marathon.somedomain.com:8080", dry_run=True) with pytest.raises(DryRun): client.deploy({"id": "test-app"})
def test_deploy_dry_run(): client = MarathonClient("http://marathon.somedomain.com:8080") client.dry_run = True with pytest.raises(DryRun): client.deploy({"id": "test-app"})