Commit c2db52ea authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Add useful messages to step assertions

parent 6a2f9b5e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -54,7 +54,8 @@ def assert_not_exist(context: Context, path: str) -> None:
		"--post_type=post,page", "--post_status=publish",
	]
	urls = {*context.site.backend.cli(*cmd, deserialiser=JSONArray.from_string)}
	assert context.site.url / path not in urls
	assert context.site.url / path not in urls, \
		f"{context.site.url / path} exists"


@given("a {post_type:PostType} exists containing")
+2 −1
Original line number Diff line number Diff line
@@ -77,4 +77,5 @@ def assert_response(context: Context, response: ResponseCode) -> None:

	"response" can be a numeric or phrasal response in ResponseCode
	"""
	assert context.response.status_code == response
	assert context.response.status_code == response, \
		f"Expected response {response}: got {context.response.status_code}"