diff --git a/cli/tests/data/marathon/apps/app_add_400.json b/cli/tests/data/marathon/apps/app_add_400.json index 347d049..4883e09 100644 --- a/cli/tests/data/marathon/apps/app_add_400.json +++ b/cli/tests/data/marathon/apps/app_add_400.json @@ -7,7 +7,7 @@ "type": "DOCKER", "docker": { "image": "busybox", - "network": "host" + "network": "bogus" } } } diff --git a/cli/tests/data/marathon/groups/complicated.json b/cli/tests/data/marathon/groups/complicated.json index ba8c404..d76c188 100644 --- a/cli/tests/data/marathon/groups/complicated.json +++ b/cli/tests/data/marathon/groups/complicated.json @@ -34,5 +34,5 @@ "id": "moregroups" } ], - "id": "test-group" + "id": "/test-group" } diff --git a/cli/tests/data/marathon/groups/complicated_bad.json b/cli/tests/data/marathon/groups/complicated_bad.json index b0fc719..469365e 100644 --- a/cli/tests/data/marathon/groups/complicated_bad.json +++ b/cli/tests/data/marathon/groups/complicated_bad.json @@ -26,5 +26,5 @@ "id": "moregroups" } ], - "id": "test-group" + "id": "/test-group" } diff --git a/cli/tests/data/marathon/groups/good.json b/cli/tests/data/marathon/groups/good.json index dc0bb62..c2f0d4e 100644 --- a/cli/tests/data/marathon/groups/good.json +++ b/cli/tests/data/marathon/groups/good.json @@ -11,5 +11,5 @@ "id": "sleep" } ], - "id": "test-group" + "id": "/test-group" } diff --git a/cli/tests/data/marathon/groups/scale.json b/cli/tests/data/marathon/groups/scale.json index e78f655..bd8a487 100644 --- a/cli/tests/data/marathon/groups/scale.json +++ b/cli/tests/data/marathon/groups/scale.json @@ -11,5 +11,5 @@ "id": "sleep" } ], - "id": "scale-group" + "id": "/scale-group" } diff --git a/cli/tests/integrations/test_marathon.py b/cli/tests/integrations/test_marathon.py index c4b4d72..d6caab5 100644 --- a/cli/tests/integrations/test_marathon.py +++ b/cli/tests/integrations/test_marathon.py @@ -246,18 +246,8 @@ def test_update_bad_type(): ['dcos', 'marathon', 'app', 'update', 'zero-instance-app', 'cpus="a string"']) - stderr_end = b"""{ - "details": [ - { - "errors": [ - "error.expected.jsnumber" - ], - "path": "/cpus" - } - ], - "message": "Invalid JSON" -} -""" + stderr_end = b"""{"message":"Invalid JSON","details":[{"path":"/cpus","errors":["error.expected.jsnumber"]}]}""" # noqa: E501 + assert returncode == 1 assert stderr_end in stderr assert stdout == b'' @@ -282,24 +272,11 @@ def test_app_add_invalid_request(): returncode, stdout, stderr = exec_command( ['dcos', 'marathon', 'app', 'add', path]) - assert returncode == 1 - assert stdout == b'' - assert re.match(b"Error on request \[POST .*\]: HTTP 400: Bad Request:", - stderr) + stderr_end = b"""{"message":"Invalid JSON","details":[{"path":"/container/docker/network","errors":["error.unknown.enum.literal"]}]}""" # noqa: E501 - stderr_end = b"""{ - "details": [ - { - "errors": [ - "host is not a valid network type" - ], - "path": "/container/docker/network" - } - ], - "message": "Invalid JSON" -} -""" - assert stderr.endswith(stderr_end) + assert returncode == 1 + assert stderr_end in stderr + assert stdout == b'' def test_update_app(): diff --git a/cli/tests/integrations/test_marathon_groups.py b/cli/tests/integrations/test_marathon_groups.py index bd4e8c5..fabf7b2 100644 --- a/cli/tests/integrations/test_marathon_groups.py +++ b/cli/tests/integrations/test_marathon_groups.py @@ -41,21 +41,11 @@ def test_add_bad_complicated_group(): ['dcos', 'marathon', 'group', 'add'], stdin=fd) - err = b"""{ - "details": [ - { - "errors": [ - "error.path.missing" - ], - "path": "/groups(0)/apps(0)/id" - } - ], - "message": "Invalid JSON" -} -""" + stderr_end = b"""{"message":"Invalid JSON","details":[{"path":"/groups(0)/apps(0)/id","errors":["\'id\' is undefined on object: {}"]}]}""" # noqa: E501 + assert returncode == 1 + assert stderr_end in stderr assert stdout == b'' - assert err in stderr def test_update_group_from_stdin():