def contains_string_matches_when_actual_string_contains_value_passed_to_matcher():
    matcher = contains_string("ab")
    assert_equal(matched(), matcher.match("ab"))
    assert_equal(matched(), matcher.match("abc"))
    assert_equal(matched(), matcher.match("abcd"))
    assert_equal(matched(), matcher.match("cabd"))
    assert_equal(matched(), matcher.match("cdab"))
    assert_equal(unmatched("was 'a'"), matcher.match("a"))
Exemplo n.º 2
0
def contains_string_matches_when_actual_string_contains_value_passed_to_matcher(
):
    matcher = contains_string("ab")
    assert_equal(matched(), matcher.match("ab"))
    assert_equal(matched(), matcher.match("abc"))
    assert_equal(matched(), matcher.match("abcd"))
    assert_equal(matched(), matcher.match("cabd"))
    assert_equal(matched(), matcher.match("cdab"))
    assert_equal(unmatched("was 'a'"), matcher.match("a"))
Exemplo n.º 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
Exemplo n.º 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))
Exemplo n.º 5
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
Exemplo n.º 6
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))
def contains_string_description_describes_value():
    matcher = contains_string("ab")
    assert_equal("contains the string 'ab'", matcher.describe())
Exemplo n.º 8
0
def contains_string_description_describes_value():
    matcher = contains_string("ab")
    assert_equal("contains the string 'ab'", matcher.describe())