Skip to content

Commit f7dc819

Browse files
committed
Facets docs are ready, I think!
1 parent 1bc93db commit f7dc819

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

selfie.dev/src/pages/py/facets.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def client():
2828
with app.test_client() as client:
2929
yield client
3030

31-
def test_homepage(client):
31+
def test_homepage_v1(client):
3232
expect_selfie(client.get("/").data.decode()).to_be("""
3333
<html><body>
3434
<h1>Please login</h1>
@@ -52,7 +52,7 @@ from werkzeug.test import TestResponse # this is what `app.test_client().get` re
5252
def web_selfie(response: TestResponse) -> StringSelfie:
5353
return expect_selfie(response.data.decode())
5454

55-
def test_homepage(client):
55+
def test_homepage_v2(client):
5656
web_selfie(client.get("/")).to_be("""
5757
<html><body>
5858
<h1>Please login</h1>
@@ -79,7 +79,7 @@ def web_selfie(response: TestResponse) -> StringSelfie:
7979
And now our snapshot has `status` at the bottom, which we can use in both literal and disk snapshots.
8080

8181
```python
82-
def test_homepage():
82+
def test_homepage_v2():
8383
expect_selfie(get("/")).toBe("""
8484
<html><body>
8585
<h1>Please login</h1>
@@ -243,7 +243,7 @@ [email protected]|JclThw==;Path=/""")
243243
status code: 401""")
244244
```
245245

246-
We just wrote a high-level specification of a realistic login flow, and it only took TODO 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 TODO](https://github.com/diffplug/selfie/issues/322) gives us an exhaustive specification and description of the server's behavior.
246+
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.
247247

248248
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.
249249

0 commit comments

Comments
 (0)