Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7575f95

Browse files
nicolas-rocheJulienPalard
authored andcommitted
Traduction de library/unittest.mock-examples (#691)
1 parent 4c75c93 commit 7575f95

File tree

1 file changed

+45
-11
lines changed

1 file changed

+45
-11
lines changed

library/unittest.mock-examples.po

Lines changed: 45 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,56 +6,66 @@ msgstr ""
66
"Project-Id-Version: Python 3.6\n"
77
"Report-Msgid-Bugs-To: \n"
88
"POT-Creation-Date: 2019-10-09 17:54+0200\n"
9-
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
10-
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
9+
"PO-Revision-Date: 2019-12-01 23:32+0100\n"
1110
"Language-Team: FRENCH <[email protected]>\n"
1211
"Language: fr\n"
1312
"MIME-Version: 1.0\n"
1413
"Content-Type: text/plain; charset=UTF-8\n"
1514
"Content-Transfer-Encoding: 8bit\n"
15+
"Last-Translator: \n"
16+
"X-Generator: Poedit 2.2.1\n"
1617

1718
#: ../Doc/library/unittest.mock-examples.rst:2
1819
msgid ":mod:`unittest.mock` --- getting started"
1920
msgstr ""
2021

2122
#: ../Doc/library/unittest.mock-examples.rst:27
2223
msgid "Using Mock"
23-
msgstr ""
24+
msgstr "Utilisation de Mock ou l'art de singer"
2425

2526
#: ../Doc/library/unittest.mock-examples.rst:30
2627
msgid "Mock Patching Methods"
27-
msgstr ""
28+
msgstr "Simulation des méthodes"
2829

2930
#: ../Doc/library/unittest.mock-examples.rst:32
3031
msgid "Common uses for :class:`Mock` objects include:"
31-
msgstr ""
32+
msgstr "Usages courant de :class:`Mock` :"
3233

3334
#: ../Doc/library/unittest.mock-examples.rst:34
3435
msgid "Patching methods"
35-
msgstr ""
36+
msgstr "Substitution des méthodes"
3637

3738
#: ../Doc/library/unittest.mock-examples.rst:35
3839
msgid "Recording method calls on objects"
39-
msgstr ""
40+
msgstr "Enregistrement des appels faits sur les objets"
4041

4142
#: ../Doc/library/unittest.mock-examples.rst:37
4243
msgid ""
4344
"You might want to replace a method on an object to check that it is called "
4445
"with the correct arguments by another part of the system:"
4546
msgstr ""
47+
"On peut remplacer une méthode sur un objet pour contrôler qu'elle est bien "
48+
"appelée avec le nombre correct d'arguments :"
4649

4750
#: ../Doc/library/unittest.mock-examples.rst:45
4851
msgid ""
4952
"Once our mock has been used (``real.method`` in this example) it has methods "
5053
"and attributes that allow you to make assertions about how it has been used."
5154
msgstr ""
55+
"Une fois notre objet simulacre appelé (via ``real.method`` dans notre "
56+
"exemple), il fournit des méthodes et attributs permettant de valider comment "
57+
"il a été appelé."
5258

5359
#: ../Doc/library/unittest.mock-examples.rst:50
5460
msgid ""
5561
"In most of these examples the :class:`Mock` and :class:`MagicMock` classes "
5662
"are interchangeable. As the ``MagicMock`` is the more capable class it makes "
5763
"a sensible one to use by default."
5864
msgstr ""
65+
"Dans la majeure partie des exemples donnés ici, les classes :class:`Mock` "
66+
"et :class:`MagicMock` sont interchangeables. Étant donné que ``MagicMock`` "
67+
"est la classe la plus puissante des deux, cela fait sens de l'utiliser par "
68+
"défaut."
5969

6070
#: ../Doc/library/unittest.mock-examples.rst:54
6171
msgid ""
@@ -64,16 +74,22 @@ msgid ""
6474
"or :meth:`~Mock.assert_called_once_with` method to check that it was called "
6575
"with the correct arguments."
6676
msgstr ""
77+
"Une fois l'objet Mock appelé, son attribut :attr:`~Mock.called` est défini à "
78+
"``True``. Qui plus est, nous pouvons utiliser les méthodes :meth:`~Mock."
79+
"assert_called_with` ou :meth:`~Mock.assert_called_once_with` pour contrôler "
80+
"qu'il a été appelé avec les bons arguments."
6781

6882
#: ../Doc/library/unittest.mock-examples.rst:59
6983
msgid ""
7084
"This example tests that calling ``ProductionClass().method`` results in a "
7185
"call to the ``something`` method:"
7286
msgstr ""
87+
"Cet exemple teste que l'appel de la méthode ``ProductionClass().method`` "
88+
"implique bien celui de la méthode ``something`` :"
7389

7490
#: ../Doc/library/unittest.mock-examples.rst:76
7591
msgid "Mock for Method Calls on an Object"
76-
msgstr ""
92+
msgstr "S'assurer de la bonne utilisation d'un objet"
7793

7894
#: ../Doc/library/unittest.mock-examples.rst:78
7995
msgid ""
@@ -82,18 +98,27 @@ msgid ""
8298
"method (or some part of the system under test) and then check that it is "
8399
"used in the correct way."
84100
msgstr ""
101+
"Dans l'exemple précédent, nous avons directement remplacé une méthode par un "
102+
"objet (afin de valider que l'appel était correct). Une autre façon de faire "
103+
"est de passer un objet Mock en argument d'une méthode (ou de tout autre "
104+
"partie du code à tester) et ensuite de contrôler que notre objet a été "
105+
"utilisé de la façon attendue."
85106

86107
#: ../Doc/library/unittest.mock-examples.rst:83
87108
msgid ""
88109
"The simple ``ProductionClass`` below has a ``closer`` method. If it is "
89110
"called with an object then it calls ``close`` on it."
90111
msgstr ""
112+
"Ci-dessous, ``ProductionClass`` dispose d'une méthode ``closer``. Si on "
113+
"l'appelle avec un objet, alors elle appelle la méthode ``close`` dessus."
91114

92115
#: ../Doc/library/unittest.mock-examples.rst:91
93116
msgid ""
94117
"So to test it we need to pass in an object with a ``close`` method and check "
95118
"that it was called correctly."
96119
msgstr ""
120+
"Ainsi, pour tester cette classe, nous devons lui passer un objet ayant une "
121+
"méthode ``close``, puis vérifier qu'elle a bien été appelée."
97122

98123
#: ../Doc/library/unittest.mock-examples.rst:99
99124
msgid ""
@@ -102,10 +127,15 @@ msgid ""
102127
"accessing it in the test will create it, but :meth:`~Mock."
103128
"assert_called_with` will raise a failure exception."
104129
msgstr ""
130+
"En fait, nous n'avons pas à nous soucier de fournir la méthode ``close`` "
131+
"dans notre objet « simulé ». Le simple fait d'accéder à la méthode ``close`` "
132+
"l'a crée. Si par contre la méthode ``close`` n'a pas été appelée alors, bien "
133+
"que le test la créée en y accédant, :meth:`~Mock.assert_called_with` lèvera "
134+
"une exception."
105135

106136
#: ../Doc/library/unittest.mock-examples.rst:106
107137
msgid "Mocking Classes"
108-
msgstr ""
138+
msgstr "Simulation des classes"
109139

110140
#: ../Doc/library/unittest.mock-examples.rst:108
111141
msgid ""
@@ -114,6 +144,11 @@ msgid ""
114144
"Instances are created by *calling the class*. This means you access the "
115145
"\"mock instance\" by looking at the return value of the mocked class."
116146
msgstr ""
147+
"Un cas d'utilisation courant consiste à émuler les classes instanciées par "
148+
"le code que nous testons. Quand on *patch* une classe, alors cette classe "
149+
"est remplacée par un objet *mock*. Les instances de la classe étant créées "
150+
"en *appelant la classe*, on accède à « l'instance *mock* » via la valeur de "
151+
"retour de la classe émulée."
117152

118153
#: ../Doc/library/unittest.mock-examples.rst:113
119154
msgid ""
@@ -341,9 +376,8 @@ msgid ""
341376
msgstr ""
342377

343378
#: ../Doc/library/unittest.mock-examples.rst:388
344-
#, fuzzy
345379
msgid "``patch.object``::"
346-
msgstr "``patch.object``:"
380+
msgstr "``patch.object`` ::"
347381

348382
#: ../Doc/library/unittest.mock-examples.rst:405
349383
msgid ""

0 commit comments

Comments
 (0)