Skip to content

Commit 49ad3e0

Browse files
committed
Rename chapter 20
1 parent b01bf59 commit 49ad3e0

10 files changed

+28
-27
lines changed

.gitmodules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@
8585
[submodule "source/chapter_22/superlists"]
8686
path = source/chapter_page_pattern/superlists
8787
url = [email protected]:hjwp/book-example.git
88-
[submodule "source/chapter_fixtures_and_wait_decorator/superlists"]
89-
path = source/chapter_fixtures_and_wait_decorator/superlists
88+
[submodule "source/chapter_20_fixtures_and_wait_decorator/superlists"]
89+
path = source/chapter_20_fixtures_and_wait_decorator/superlists
9090
url = [email protected]:hjwp/book-example.git
9191
[submodule "source/chapter_12_organising_test_files/superlists"]
9292
path = source/chapter_12_organising_test_files/superlists

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ test_chapter_18_spiking_custom_auth: chapter_18_spiking_custom_auth.html $(TMPDI
131131
.PHONY: test_chapter_19_mocking
132132
test_chapter_19_mocking: chapter_19_mocking.html $(TMPDIR) $(VENV)/bin
133133
$(VENV)/bin/pytest -s --tb=short ./tests/test_chapter_19_mocking.py
134-
.PHONY: test_chapter_fixtures_and_wait_decorator
135-
test_chapter_fixtures_and_wait_decorator: chapter_fixtures_and_wait_decorator.html $(TMPDIR) $(VENV)/bin
136-
$(VENV)/bin/pytest -s --tb=short ./tests/test_chapter_fixtures_and_wait_decorator.py
134+
.PHONY: test_chapter_20_fixtures_and_wait_decorator
135+
test_chapter_20_fixtures_and_wait_decorator: chapter_20_fixtures_and_wait_decorator.html $(TMPDIR) $(VENV)/bin
136+
$(VENV)/bin/pytest -s --tb=short ./tests/test_chapter_20_fixtures_and_wait_decorator.py
137137
.PHONY: test_chapter_server_side_debugging
138138
test_chapter_server_side_debugging: chapter_server_side_debugging.html $(TMPDIR) $(VENV)/bin
139139
$(VENV)/bin/pytest -s --tb=short ./tests/test_chapter_server_side_debugging.py

appendix_github_links.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Full List of Links for Each Chapter
3838
<<chapter_17_second_deploy>>:: https://github.com/hjwp/book-example/tree/chapter_17_second_deploy
3939
<<chapter_18_spiking_custom_auth>>:: https://github.com/hjwp/book-example/tree/chapter_18_spiking_custom_auth
4040
<<chapter_19_mocking>>:: https://github.com/hjwp/book-example/tree/chapter_19_mocking
41-
<<chapter_fixtures_and_wait_decorator>>:: https://github.com/hjwp/book-example/tree/chapter_fixtures_and_wait_decorator
41+
<<chapter_20_fixtures_and_wait_decorator>>:: https://github.com/hjwp/book-example/tree/chapter_20_fixtures_and_wait_decorator
4242
<<chapter_server_side_debugging>>:: https://github.com/hjwp/book-example/tree/chapter_server_side_debugging
4343
<<chapter_outside_in>>:: https://github.com/hjwp/book-example/tree/chapter_outside_in
4444
<<chapter_purist_unit_tests>>:: https://github.com/hjwp/book-example/tree/chapter_purist_unit_tests

atlas.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"part3.asciidoc",
3333
"chapter_18_spiking_custom_auth.asciidoc",
3434
"chapter_19_mocking.asciidoc",
35-
"chapter_fixtures_and_wait_decorator.asciidoc",
35+
"chapter_20_fixtures_and_wait_decorator.asciidoc",
3636
"chapter_server_side_debugging.asciidoc",
3737
"chapter_outside_in.asciidoc",
3838
"chapter_purist_unit_tests.asciidoc",

book.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ include::chapter_17_second_deploy.asciidoc[]
4343
include::part3.forbook.asciidoc[]
4444
include::chapter_18_spiking_custom_auth.asciidoc[]
4545
include::chapter_19_mocking.asciidoc[]
46-
include::chapter_fixtures_and_wait_decorator.asciidoc[]
46+
include::chapter_20_fixtures_and_wait_decorator.asciidoc[]
4747
include::chapter_server_side_debugging.asciidoc[]
4848
include::chapter_outside_in.asciidoc[]
4949
include::chapter_purist_unit_tests.asciidoc[]

chapter_fixtures_and_wait_decorator.asciidoc renamed to chapter_20_fixtures_and_wait_decorator.asciidoc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[[chapter_fixtures_and_wait_decorator]]
1+
[[chapter_20_fixtures_and_wait_decorator]]
22
Test Fixtures and a Decorator for [keep-together]#Explicit Waits#
33
-----------------------------------------------------------------
44

@@ -281,8 +281,10 @@ $ *git commit -m "test_my_lists: precreate sessions, move login checks into base
281281

282282
.JSON Test Fixtures Considered Harmful
283283
*******************************************************************************
284-
((("JSON fixtures")))((("fixtures", "JSON fixtures")))((("test fixtures")))When
285-
we pre-populate the database with test data, as we've done here with the
284+
((("JSON fixtures")))
285+
((("fixtures", "JSON fixtures")))
286+
((("test fixtures")))
287+
When we pre-populate the database with test data, as we've done here with the
286288
`User` object and its associated `Session` object, what we're doing is setting
287289
up a "test fixture".
288290

tests/chapters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# part 3
2222
"chapter_18_spiking_custom_auth",
2323
"chapter_19_mocking",
24-
"chapter_fixtures_and_wait_decorator",
24+
"chapter_20_fixtures_and_wait_decorator",
2525
"chapter_server_side_debugging",
2626
"chapter_outside_in",
2727
"chapter_purist_unit_tests",
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,35 @@
11
#!/usr/bin/env python3
2+
import os
23
import unittest
34

45
from book_tester import ChapterTest
56

67

7-
class Chapter18Test(ChapterTest):
8-
chapter_name = 'chapter_fixtures_and_wait_decorator'
9-
previous_chapter = 'chapter_19_mocking'
8+
class Chapter20Test(ChapterTest):
9+
chapter_name = "chapter_20_fixtures_and_wait_decorator"
10+
previous_chapter = "chapter_19_mocking"
1011

1112
def test_listings_and_commands_and_output(self):
1213
self.parse_listings()
1314

1415
# sanity checks
15-
self.assertEqual(self.listings[0].type, 'code listing')
16-
self.assertEqual(self.listings[1].type, 'other command')
17-
self.assertEqual(self.listings[2].type, 'output')
16+
self.assertEqual(self.listings[0].type, "code listing")
17+
self.assertEqual(self.listings[1].type, "other command")
18+
self.assertEqual(self.listings[2].type, "output")
1819

1920
# skips
20-
#self.skip_with_check(22, 'switch back to master') # comment
21+
# self.skip_with_check(22, 'switch back to master') # comment
2122

2223
# prep
2324
self.start_with_checkout()
2425
self.prep_database()
25-
self.sourcetree.run_command('rm accounts/tests.py')
2626

2727
# hack fast-forward
28-
skip = False
29-
if skip:
28+
if os.environ.get("SKIP"):
3029
self.pos = 10
31-
self.sourcetree.run_command('git checkout {0}'.format(
32-
self.sourcetree.get_commit_spec('ch17l004')
33-
))
30+
self.sourcetree.run_command(
31+
"git checkout {}".format(self.sourcetree.get_commit_spec("ch17l004"))
32+
)
3433

3534
while self.pos < len(self.listings):
3635
print(self.pos)
@@ -43,5 +42,5 @@ def test_listings_and_commands_and_output(self):
4342
self.check_final_diff(ignore=["moves"])
4443

4544

46-
if __name__ == '__main__':
45+
if __name__ == "__main__":
4746
unittest.main()

tests/test_chapter_server_side_debugging.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
class Chapter18Test(ChapterTest):
1010
chapter_name = 'chapter_server_side_debugging'
11-
previous_chapter = 'chapter_fixtures_and_wait_decorator'
11+
previous_chapter = 'chapter_20_fixtures_and_wait_decorator'
1212

1313

1414
def test_listings_and_commands_and_output(self):

0 commit comments

Comments
 (0)