Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 558ba89

Browse files
committed
Update transcript in Testing Chapter 5
The word "mark" in the transcripts should be "mock". Updated the transcript.
1 parent c315e93 commit 558ba89

File tree

1 file changed

+4
-4
lines changed
  • transcripts/10-testing

1 file changed

+4
-4
lines changed

‎transcripts/10-testing/5.txt‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
00:26 What I do need is to import the actual program.
1010
00:29 So from guess import get random number and the game class.
1111
00:35 Now, one thing I want to show you in this video is how to
12-
00:38 mark an object. Because Get Random Number, as you can see
12+
00:38 mock an object. Because Get Random Number, as you can see
1313
00:42 at the right, uses a random integer from start to end.
1414
00:45 And random returns to something randomly every time.
1515
00:49 So how do you actually test that? And the way to do that
16-
00:52 in testing land is to mark an object.
16+
00:52 in testing land is to mock an object.
1717
00:54 And for this I'm just going to use the unittest
18-
00:57 patch method on the mark module
18+
00:57 patch method on the mock module
1919
01:00 because it's a perfect fit for this scenario.
2020
01:05 So from unittest.mark, import patch.
2121
01:10 I actually need to import to random module
@@ -38,7 +38,7 @@
3838
02:14 cannot really control and I have another example later
3939
02:17 about the input function where we ask for user input,
4040
02:21 which is another area that can be anything,
41-
02:24 so you want to mark that out.
41+
02:24 so you want to mock that out.
4242
02:27 So with this code written,
4343
02:28 let's go back to the command line and run this test.
4444
02:31 And I'm using Control Z on a Mac with foreground to

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /