Skip to content

Commit e2b1bc4

Browse files
committed
Test for the right URL being emitted
1 parent 953272a commit e2b1bc4

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tests/test_main.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def test_deploy(self):
113113
],
114114
)
115115
@httpretty.activate(verbose=True, allow_net_connect=False)
116-
def test_deploy_draft(self, command, target, expected_activate):
116+
def test_deploy_draft(self, command, target, expected_activate, caplog):
117117
original_api_key_value = os.environ.pop("CONNECT_API_KEY", None)
118118
original_server_value = os.environ.pop("CONNECT_SERVER", None)
119119

@@ -241,10 +241,15 @@ def post_application_deploy_callback(request, uri, response_headers):
241241
# Do not validate app mode, so that the "target" content doesn't matter.
242242
"rsconnect.api.RSConnectExecutor.validate_app_mode",
243243
new=lambda self_, *args, **kwargs: self_,
244-
):
244+
), caplog.at_level("INFO"):
245245
result = runner.invoke(cli, args)
246246
assert result.exit_code == 0, result.output
247247
assert deploy_api_invoked == [True]
248+
assert "Deployment completed successfully." in caplog.text
249+
if expected_activate:
250+
assert "Direct content URL: http://fake_server/apps/1234-5678-9012-3456" in caplog.text
251+
else:
252+
assert "Direct content URL: http://fake_server/preview/1234-5678-9012-3456/FAKE_BUNDLE_ID" in caplog.text
248253
finally:
249254
if original_api_key_value:
250255
os.environ["CONNECT_API_KEY"] = original_api_key_value

0 commit comments

Comments
 (0)