예제 #1
0
def test_run_app_with_non_downloadable_artifact():
    """Runs an app with a non-downloadable artifact."""

    app_def = apps.sleep_app()
    app_def['fetch'] = [{"uri": "http://localhost/missing-artifact"}]

    client = marathon.create_client()
    client.add_app(app_def)

    assert_that(lambda: client.get_app(app_def["id"]), eventually(
        prop(['lastTaskFailure', 'message'], contains_string("Failed to fetch all URIs for container")), max_attempts=30)) # NOQA E501
예제 #2
0
def test_run_app_with_non_existing_user():
    """Runs an app with a non-existing user, which should be failing."""

    app_def = apps.sleep_app()
    app_def['user'] = '******'

    client = marathon.create_client()
    client.add_app(app_def)

    assert_that(lambda: client.get_app(app_def["id"]), eventually(
        prop(['lastTaskFailure', 'message'], contains_string("No such user 'bad'")), max_attempts=30))
예제 #3
0
def test_run_app_with_non_downloadable_artifact():
    """Runs an app with a non-downloadable artifact."""

    app_def = apps.sleep_app()
    app_def['fetch'] = [{"uri": "http://localhost/missing-artifact"}]

    client = marathon.create_client()
    client.add_app(app_def)

    assert_that(lambda: client.get_app(app_def["id"]),
                eventually(prop(
                    ['lastTaskFailure', 'message'],
                    contains_string("Failed to fetch all URIs for container")),
                           max_attempts=30))  # NOQA E501
예제 #4
0
def test_run_app_with_non_existing_user():
    """Runs an app with a non-existing user, which should be failing."""

    app_def = apps.sleep_app()
    app_def['user'] = '******'

    client = marathon.create_client()
    client.add_app(app_def)

    assert_that(
        lambda: client.get_app(app_def["id"]),
        eventually(prop(['lastTaskFailure', 'message'],
                        contains_string("No such user 'bad'")),
                   max_attempts=30))