From 1ce2565aa79a585cf4aed6b558ce124e2e2434e2 Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Sun, 15 Dec 2024 23:51:47 -0800 Subject: [PATCH] app_account -> facets --- .../{app_account_test.py => facets_test.py} | 1 - .../{app_account_test.ss => facets_test.ss} | 26 ------------------- selfie.dev/src/pages/py/facets.mdx | 2 +- 3 files changed, 1 insertion(+), 28 deletions(-) rename python/example-pytest-selfie/tests/{app_account_test.py => facets_test.py} (99%) rename python/example-pytest-selfie/tests/{app_account_test.ss => facets_test.ss} (74%) diff --git a/python/example-pytest-selfie/tests/app_account_test.py b/python/example-pytest-selfie/tests/facets_test.py similarity index 99% rename from python/example-pytest-selfie/tests/app_account_test.py rename to python/example-pytest-selfie/tests/facets_test.py index 91b8c0af..562587f0 100644 --- a/python/example-pytest-selfie/tests/app_account_test.py +++ b/python/example-pytest-selfie/tests/facets_test.py @@ -42,7 +42,6 @@ def test_homepage_v2(client): ╔═ [status] ═╗ 200 OK""") - def test_login_flow(client): web_selfie(client.get("/")).to_match_disk("1. not logged in").facet("md").to_be( "Please login" diff --git a/python/example-pytest-selfie/tests/app_account_test.ss b/python/example-pytest-selfie/tests/facets_test.ss similarity index 74% rename from python/example-pytest-selfie/tests/app_account_test.ss rename to python/example-pytest-selfie/tests/facets_test.ss index 90608fd0..b3c11157 100644 --- a/python/example-pytest-selfie/tests/app_account_test.ss +++ b/python/example-pytest-selfie/tests/facets_test.ss @@ -46,32 +46,6 @@ Check your email for your login link. Welcome back user@domain.com ╔═ test_login_flow/3. log in works with cookies[status] ═╗ 200 OK -╔═ test_login_flow/3. log in works with those cookies ═╗ - - -

- Welcome back user@domain.com -

- - - -╔═ test_login_flow/3. log in works with those cookies[md] ═╗ -Welcome back user@domain.com -╔═ test_login_flow/3. log in works with those cookies[status] ═╗ -200 OK -╔═ test_login_flow/4. log in blocked without cookies ═╗ - - -

- Welcome back user@domain.com -

- - - -╔═ test_login_flow/4. log in blocked without cookies[md] ═╗ -Welcome back user@domain.com -╔═ test_login_flow/4. log in blocked without cookies[status] ═╗ -200 OK ╔═ test_login_flow/4. log in fails with fake cookies ═╗ diff --git a/selfie.dev/src/pages/py/facets.mdx b/selfie.dev/src/pages/py/facets.mdx index 344939b4..98348a0d 100644 --- a/selfie.dev/src/pages/py/facets.mdx +++ b/selfie.dev/src/pages/py/facets.mdx @@ -243,7 +243,7 @@ login=user@domain.com|JclThw==;Path=/""") status code: 401""") ``` -We just wrote a high-level specification of a realistic login flow, and it only took 24 lines of python code — most of which were generated for us, and could be regenerated on a whim if we want to change our copywriting. The [corresponding disk snapshot](https://github.com/diffplug/selfie/blob/main/python/example-pytest-selfie/tests/app_account_test.ss) gives us an exhaustive specification and description of the server's behavior. +We just wrote a high-level specification of a realistic login flow, and it only took 24 lines of python code — most of which were generated for us, and could be regenerated on a whim if we want to change our copywriting. The [corresponding disk snapshot](https://github.com/diffplug/selfie/blob/main/python/example-pytest-selfie/tests/facets_test.ss) gives us an exhaustive specification and description of the server's behavior. Didn't think that adopting a bugfixed version of your internationalization lib would cause any changes to your website whatsever? Oops. Don't wade through failed assertions, get a diff in every failure. If you want, regenerate all the snapshots to get a full view of the problem across the whole codebase in your git client.