From 000147a4ede85c10b9ee432dd5d37b5a460ca4de Mon Sep 17 00:00:00 2001 From: fjsevilla-dev Date: Sat, 3 Oct 2020 11:13:22 +0200 Subject: [PATCH 01/10] Traducido archivo unittest.mock --- dictionaries/library_unittest.mock.txt | 0 library/unittest.mock.po | 2279 +++++++++++++++++------- 2 files changed, 1615 insertions(+), 664 deletions(-) create mode 100644 dictionaries/library_unittest.mock.txt diff --git a/dictionaries/library_unittest.mock.txt b/dictionaries/library_unittest.mock.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/library/unittest.mock.po b/library/unittest.mock.po index db04d04cd8..e2853b4002 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -6,107 +6,148 @@ # Check https://github.com/python/python-docs-es/blob/3.8/TRANSLATORS to # get the list of volunteers # -#, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.8\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-05 12:54+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" +"PO-Revision-Date: 2020-10-03 11:06+0200\n" "Language-Team: python-doc-es\n" "MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" +"Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 2.8.0\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Last-Translator: Francisco Jesús Sevilla García \n" +"Language: es\n" +"X-Generator: Poedit 2.4.1\n" #: ../Doc/library/unittest.mock.rst:3 msgid ":mod:`unittest.mock` --- mock object library" -msgstr "" +msgstr "Biblioteca de objetos simulados" #: ../Doc/library/unittest.mock.rst:13 msgid "**Source code:** :source:`Lib/unittest/mock.py`" -msgstr "" +msgstr "**Source code:** :source:`Lib/unittest/mock.py`" #: ../Doc/library/unittest.mock.rst:17 msgid "" ":mod:`unittest.mock` is a library for testing in Python. It allows you to " -"replace parts of your system under test with mock objects and make " -"assertions about how they have been used." +"replace parts of your system under test with mock objects and make assertions " +"about how they have been used." msgstr "" +":mod:`unittest.mock` es una biblioteca para pruebas de software en Python. Te " +"permite reemplazar partes del sistema bajo prueba con objetos simulados y hacer " +"aserciones sobre cómo se han utilizado." #: ../Doc/library/unittest.mock.rst:21 msgid "" -":mod:`unittest.mock` provides a core :class:`Mock` class removing the need " -"to create a host of stubs throughout your test suite. After performing an " -"action, you can make assertions about which methods / attributes were used " -"and arguments they were called with. You can also specify return values and " -"set needed attributes in the normal way." +":mod:`unittest.mock` provides a core :class:`Mock` class removing the need to " +"create a host of stubs throughout your test suite. After performing an action, " +"you can make assertions about which methods / attributes were used and " +"arguments they were called with. You can also specify return values and set " +"needed attributes in the normal way." msgstr "" +"El módulo :mod:`unittest.mock` proporciona una clase principal :class:`Mock` " +"eliminando la necesidad de crear una gran cantidad de stubs en todo el conjunto " +"de pruebas. Después de realizar una determinada acción, puedes hacer aserciones " +"sobre qué métodos/atributos se usaron y los argumentos con los que se llamaron. " +"También puedes especificar valores de retorno y establecer los atributos " +"necesarios de la forma habitual." #: ../Doc/library/unittest.mock.rst:27 msgid "" "Additionally, mock provides a :func:`patch` decorator that handles patching " -"module and class level attributes within the scope of a test, along with :" -"const:`sentinel` for creating unique objects. See the `quick guide`_ for " -"some examples of how to use :class:`Mock`, :class:`MagicMock` and :func:" -"`patch`." +"module and class level attributes within the scope of a test, along with :const:" +"`sentinel` for creating unique objects. See the `quick guide`_ for some " +"examples of how to use :class:`Mock`, :class:`MagicMock` and :func:`patch`." msgstr "" +"Además, mock proporciona un decorador :func:`patch` que puede manejar el " +"parcheo de atributos de clase y a nivel de módulo dentro del ámbito de una " +"prueba, junto con :const:`sentinel` para crear objetos únicos. Consulta la " +"`quick guide`_ para ver algunos ejemplos de cómo utilizar :class:`Mock`, :class:" +"`MagicMock` y :func:`patch`." #: ../Doc/library/unittest.mock.rst:33 msgid "" -"Mock is very easy to use and is designed for use with :mod:`unittest`. Mock " -"is based on the 'action -> assertion' pattern instead of 'record -> replay' " -"used by many mocking frameworks." +"Mock is very easy to use and is designed for use with :mod:`unittest`. Mock is " +"based on the 'action -> assertion' pattern instead of 'record -> replay' used " +"by many mocking frameworks." msgstr "" +"Mock es muy fácil de usar y está diseñado para ser utilizado con :mod:" +"`unittest`. Mock se basa en el patrón 'acción -> aserción' en lugar de usar el " +"patrón 'grabación -> reproducción' utilizado por muchos frameworks de " +"simulación." #: ../Doc/library/unittest.mock.rst:37 msgid "" "There is a backport of :mod:`unittest.mock` for earlier versions of Python, " "available as `mock on PyPI `_." msgstr "" +"Hay un backport del módulo :mod:`unittest.mock` para versiones anteriores de " +"Python, `disponible en PyPI `_." #: ../Doc/library/unittest.mock.rst:42 msgid "Quick Guide" -msgstr "" +msgstr "Guía rápida" #: ../Doc/library/unittest.mock.rst:60 msgid "" -":class:`Mock` and :class:`MagicMock` objects create all attributes and " -"methods as you access them and store details of how they have been used. You " -"can configure them, to specify return values or limit what attributes are " +":class:`Mock` and :class:`MagicMock` objects create all attributes and methods " +"as you access them and store details of how they have been used. You can " +"configure them, to specify return values or limit what attributes are " "available, and then make assertions about how they have been used:" msgstr "" +"La objetos de las clases :class:`Mock` y :class:`MagicMock` van creando todos " +"los atributos y métodos a medida que se accede a ellos y almacenan los detalles " +"de cómo se han utilizado. Puedes configurarlos para especificar valores de " +"retorno o limitar qué atributos están disponibles y luego hacer aserciones " +"sobre cómo se han utilizado:" #: ../Doc/library/unittest.mock.rst:72 msgid "" ":attr:`side_effect` allows you to perform side effects, including raising an " "exception when a mock is called:" msgstr "" +":attr:`side_effect` te permite implementar efectos colaterales, lo que incluye " +"lanzar una excepción cuando se llama a un objeto simulado:" #: ../Doc/library/unittest.mock.rst:92 msgid "" "Mock has many other ways you can configure it and control its behaviour. For " -"example the *spec* argument configures the mock to take its specification " -"from another object. Attempting to access attributes or methods on the mock " -"that don't exist on the spec will fail with an :exc:`AttributeError`." +"example the *spec* argument configures the mock to take its specification from " +"another object. Attempting to access attributes or methods on the mock that " +"don't exist on the spec will fail with an :exc:`AttributeError`." msgstr "" +"Existen muchas otras formas de configurar y controlar el comportamiento de " +"Mock. Por ejemplo, el argumento *spec* configura el objeto simulado para que " +"tome su especificación de otro objeto. El intento de acceder a atributos o " +"métodos en el objeto simulado que no existen en la especificación fallará con " +"una excepción :exc:`AttributeError`." #: ../Doc/library/unittest.mock.rst:97 msgid "" -"The :func:`patch` decorator / context manager makes it easy to mock classes " -"or objects in a module under test. The object you specify will be replaced " -"with a mock (or other object) during the test and restored when the test " -"ends::" +"The :func:`patch` decorator / context manager makes it easy to mock classes or " +"objects in a module under test. The object you specify will be replaced with a " +"mock (or other object) during the test and restored when the test ends::" msgstr "" +"El decorador :func:`patch` / administrador de contexto facilita la simulación " +"de clases u objetos en un módulo bajo prueba. El objeto que especifiques será " +"reemplazado por un objeto simulado (u otro objeto) durante la prueba y " +"restaurado cuando esta finalice:" #: ../Doc/library/unittest.mock.rst:116 msgid "" "When you nest patch decorators the mocks are passed in to the decorated " "function in the same order they applied (the normal *Python* order that " -"decorators are applied). This means from the bottom up, so in the example " -"above the mock for ``module.ClassName1`` is passed in first." +"decorators are applied). This means from the bottom up, so in the example above " +"the mock for ``module.ClassName1`` is passed in first." msgstr "" +"Cuando anidas decoradores de parcheo, los objetos simulados se pasan a la " +"función decorada en el mismo orden en que se aplicaron (el orden normal en el " +"que se aplican los decoradores en *Python*). Esto significa de abajo hacia " +"arriba, por lo que en el ejemplo anterior se pasa primero el objeto simulado " +"para ``module.ClassName1``." #: ../Doc/library/unittest.mock.rst:121 msgid "" @@ -114,108 +155,159 @@ msgid "" "they are looked up. This is normally straightforward, but for a quick guide " "read :ref:`where to patch `." msgstr "" +"Al usar :func: `patch` es importante que parchees los objetos en el espacio de " +"nombres donde son buscados. Esto normalmente es sencillo, pero para una guía " +"rápida, lee :ref:`dónde parchear `." #: ../Doc/library/unittest.mock.rst:125 msgid "" -"As well as a decorator :func:`patch` can be used as a context manager in a " -"with statement:" +"As well as a decorator :func:`patch` can be used as a context manager in a with " +"statement:" msgstr "" +"Además de como un decorador, lafunción :func:`patch` se puede usar como " +"administrador de contexto en una declaración with:" #: ../Doc/library/unittest.mock.rst:135 msgid "" -"There is also :func:`patch.dict` for setting values in a dictionary just " -"during a scope and restoring the dictionary to its original state when the " -"test ends:" +"There is also :func:`patch.dict` for setting values in a dictionary just during " +"a scope and restoring the dictionary to its original state when the test ends:" msgstr "" +"También existe la función :func:`patch.dict` que permite establecer valores en " +"un diccionario dentro de un ámbito y restaurar el diccionario a su estado " +"original cuando finaliza la prueba:" #: ../Doc/library/unittest.mock.rst:146 msgid "" -"Mock supports the mocking of Python :ref:`magic methods `. " -"The easiest way of using magic methods is with the :class:`MagicMock` class. " -"It allows you to do things like:" +"Mock supports the mocking of Python :ref:`magic methods `. The " +"easiest way of using magic methods is with the :class:`MagicMock` class. It " +"allows you to do things like:" msgstr "" +"Mock admite la simulación de los :ref:`métodos mágicos ` de " +"Python. La forma más sencilla de utilizar métodos mágicos es mediante la clase :" +"class:`MagicMock`. Te permite hacer cosas como:" #: ../Doc/library/unittest.mock.rst:156 msgid "" -"Mock allows you to assign functions (or other Mock instances) to magic " -"methods and they will be called appropriately. The :class:`MagicMock` class " -"is just a Mock variant that has all of the magic methods pre-created for you " -"(well, all the useful ones anyway)." +"Mock allows you to assign functions (or other Mock instances) to magic methods " +"and they will be called appropriately. The :class:`MagicMock` class is just a " +"Mock variant that has all of the magic methods pre-created for you (well, all " +"the useful ones anyway)." msgstr "" +"Mock también permite asignar funciones (u otras instancias de Mock) a métodos " +"mágicos y se asegura de que serán llamadas de forma apropiada. La clase :class:" +"`MagicMock` es solo una variante de Mock que tiene todos los métodos mágicos " +"previamente creados para ti (bueno, todos los que son útiles)." #: ../Doc/library/unittest.mock.rst:161 msgid "" -"The following is an example of using magic methods with the ordinary Mock " -"class:" +"The following is an example of using magic methods with the ordinary Mock class:" msgstr "" +"El siguiente es un ejemplo de uso de métodos mágicos utilizando la clase Mock " +"ordinaria:" #: ../Doc/library/unittest.mock.rst:169 msgid "" "For ensuring that the mock objects in your tests have the same api as the " -"objects they are replacing, you can use :ref:`auto-speccing `. Auto-speccing can be done through the *autospec* argument to " -"patch, or the :func:`create_autospec` function. Auto-speccing creates mock " -"objects that have the same attributes and methods as the objects they are " -"replacing, and any functions and methods (including constructors) have the " -"same call signature as the real object." -msgstr "" +"objects they are replacing, you can use :ref:`auto-speccing `. " +"Auto-speccing can be done through the *autospec* argument to patch, or the :" +"func:`create_autospec` function. Auto-speccing creates mock objects that have " +"the same attributes and methods as the objects they are replacing, and any " +"functions and methods (including constructors) have the same call signature as " +"the real object." +msgstr "" +"Para asegurarte de que los objetos simulados en tus pruebas tienen la misma API " +"que los objetos que están reemplazando, puedes usar ref:`autoespecialización " +"`. La autoespecialización se puede hacer a través del argumento " +"*autospec* de patch, o mediante la función :func:`create_autospec`. La " +"autoespecialización crea objetos simulados que tienen los mismos atributos y " +"métodos que los objetos que están reemplazando, y todas las función y métodos " +"(incluidos los constructores) tienen la misma firma de llamada que los objetos " +"reales." #: ../Doc/library/unittest.mock.rst:177 msgid "" -"This ensures that your mocks will fail in the same way as your production " -"code if they are used incorrectly:" +"This ensures that your mocks will fail in the same way as your production code " +"if they are used incorrectly:" msgstr "" +"Esto asegura que tus simulaciones fallarán si se utilizan incorrectamente de la " +"misma manera que tu código de producción:" #: ../Doc/library/unittest.mock.rst:193 msgid "" ":func:`create_autospec` can also be used on classes, where it copies the " -"signature of the ``__init__`` method, and on callable objects where it " -"copies the signature of the ``__call__`` method." +"signature of the ``__init__`` method, and on callable objects where it copies " +"the signature of the ``__call__`` method." msgstr "" +":func:`create_autospec` también se puede usar en clases, donde copia la firma " +"del método ``__init__``, y en objetos invocables, donde copia la firma del " +"método ``__call__``." #: ../Doc/library/unittest.mock.rst:200 msgid "The Mock Class" -msgstr "" +msgstr "La clase Mock" #: ../Doc/library/unittest.mock.rst:211 msgid "" ":class:`Mock` is a flexible mock object intended to replace the use of stubs " -"and test doubles throughout your code. Mocks are callable and create " -"attributes as new mocks when you access them [#]_. Accessing the same " -"attribute will always return the same mock. Mocks record how you use them, " -"allowing you to make assertions about what your code has done to them." -msgstr "" +"and test doubles throughout your code. Mocks are callable and create attributes " +"as new mocks when you access them [#]_. Accessing the same attribute will " +"always return the same mock. Mocks record how you use them, allowing you to " +"make assertions about what your code has done to them." +msgstr "" +":class:`Mock` es un objeto simulado flexible, destinado a reemplazar el uso de " +"stubs y dobles de prueba en todo tu código. Los objetos Mock son invocables y " +"crean atributos en el mismo momento que se accede a ellos como nuevos objetos " +"Mock [#]_. Acceder al mismo atributo siempre retornará el mismo objeto Mock. " +"Además registran cómo los usas, lo que te permite hacer aserciones sobre cómo " +"tu código ha interaccionado con ellos." #: ../Doc/library/unittest.mock.rst:217 msgid "" ":class:`MagicMock` is a subclass of :class:`Mock` with all the magic methods " -"pre-created and ready to use. There are also non-callable variants, useful " -"when you are mocking out objects that aren't callable: :class:" -"`NonCallableMock` and :class:`NonCallableMagicMock`" +"pre-created and ready to use. There are also non-callable variants, useful when " +"you are mocking out objects that aren't callable: :class:`NonCallableMock` and :" +"class:`NonCallableMagicMock`" msgstr "" +":class:`MagicMock` es una subclase de :class:`Mock` con todos los métodos " +"mágicos creados previamente y listos para ser usados. También hay variantes no " +"invocables, útiles cuando se están simulando objetos que no se pueden llamar: :" +"class:`NonCallableMock` y :class:`NonCallableMagicMock`" #: ../Doc/library/unittest.mock.rst:222 msgid "" -"The :func:`patch` decorators makes it easy to temporarily replace classes in " -"a particular module with a :class:`Mock` object. By default :func:`patch` " -"will create a :class:`MagicMock` for you. You can specify an alternative " -"class of :class:`Mock` using the *new_callable* argument to :func:`patch`." +"The :func:`patch` decorators makes it easy to temporarily replace classes in a " +"particular module with a :class:`Mock` object. By default :func:`patch` will " +"create a :class:`MagicMock` for you. You can specify an alternative class of :" +"class:`Mock` using the *new_callable* argument to :func:`patch`." msgstr "" +"Los decoradores :func:`patch` facilitan la sustitución temporal de clases en un " +"módulo en particular con un objeto :class:`Mock`. Por defecto :func:`patch` " +"creará un objeto :class:`MagicMock` automáticamente. Se puede especificar una " +"clase alternativa a :class:`Mock` usando el argumento *new_callable* de :func:" +"`patch`." #: ../Doc/library/unittest.mock.rst:230 msgid "" "Create a new :class:`Mock` object. :class:`Mock` takes several optional " "arguments that specify the behaviour of the Mock object:" msgstr "" +"Crea un nuevo objeto :class:`Mock`. :class:`Mock` toma varios argumentos " +"opcionales que especifican el comportamiento del objeto Mock:" #: ../Doc/library/unittest.mock.rst:233 msgid "" -"*spec*: This can be either a list of strings or an existing object (a class " -"or instance) that acts as the specification for the mock object. If you pass " -"in an object then a list of strings is formed by calling dir on the object " -"(excluding unsupported magic attributes and methods). Accessing any " -"attribute not in this list will raise an :exc:`AttributeError`." +"*spec*: This can be either a list of strings or an existing object (a class or " +"instance) that acts as the specification for the mock object. If you pass in an " +"object then a list of strings is formed by calling dir on the object (excluding " +"unsupported magic attributes and methods). Accessing any attribute not in this " +"list will raise an :exc:`AttributeError`." msgstr "" +"*spec*: puede ser una lista de cadenas de caracteres o un objeto existente " +"previamente (una clase o una instancia) que actúa como la especificación del " +"objeto simulado. Si pasas un objeto, se forma una lista de cadenas llamando a " +"la función *dir* en el objeto (excluyendo los métodos y atributos mágicos no " +"admitidos). Acceder a cualquier atributo que no esté en esta lista generará una " +"excepción :exc:`AttributeError`." #: ../Doc/library/unittest.mock.rst:239 msgid "" @@ -223,45 +315,63 @@ msgid "" "__class__` returns the class of the spec object. This allows mocks to pass :" "func:`isinstance` tests." msgstr "" +"Si *spec* es un objeto (en lugar de una lista de cadenas de caracteres), :attr:" +"`~instance.__class__` retorna la clase del objeto especificado. Esto permite " +"que los objetos simulados pasen las pruebas :func:`isinstance`." #: ../Doc/library/unittest.mock.rst:243 msgid "" -"*spec_set*: A stricter variant of *spec*. If used, attempting to *set* or " -"get an attribute on the mock that isn't on the object passed as *spec_set* " -"will raise an :exc:`AttributeError`." +"*spec_set*: A stricter variant of *spec*. If used, attempting to *set* or get " +"an attribute on the mock that isn't on the object passed as *spec_set* will " +"raise an :exc:`AttributeError`." msgstr "" +"*spec_set*: Una variante más estricta de *spec*. Si se utiliza, cualquier " +"intento de *establecer* u obtener un atributo del objeto simulado que no esté " +"en el objeto pasado como *spec_set* lanzará una excepción :exc:`AttributeError`." #: ../Doc/library/unittest.mock.rst:247 msgid "" "*side_effect*: A function to be called whenever the Mock is called. See the :" "attr:`~Mock.side_effect` attribute. Useful for raising exceptions or " "dynamically changing return values. The function is called with the same " -"arguments as the mock, and unless it returns :data:`DEFAULT`, the return " -"value of this function is used as the return value." +"arguments as the mock, and unless it returns :data:`DEFAULT`, the return value " +"of this function is used as the return value." msgstr "" +"*side_effect*: Una función que se llamará cada vez que el objeto simulado sea " +"llamado. Consultar el atributo :attr:`~Mock.side_effect` para más información. " +"Es útil para lanzar excepciones o para cambiar dinámicamente valores de " +"retorno. La función se llama con los mismos argumentos que el objeto simulado, " +"y a menos que retorne :data:`DEFAULT`, su valor de retorno se utiliza como " +"valor de retorno del propio objeto simulado." #: ../Doc/library/unittest.mock.rst:253 msgid "" -"Alternatively *side_effect* can be an exception class or instance. In this " -"case the exception will be raised when the mock is called." +"Alternatively *side_effect* can be an exception class or instance. In this case " +"the exception will be raised when the mock is called." msgstr "" +"Alternativamente *side_effect* puede ser una clase o instancia de excepción. En " +"este caso se lanza la excepción cuando el objeto simulado es llamado." #: ../Doc/library/unittest.mock.rst:256 msgid "" -"If *side_effect* is an iterable then each call to the mock will return the " -"next value from the iterable." +"If *side_effect* is an iterable then each call to the mock will return the next " +"value from the iterable." msgstr "" +"Si *side_effect* es un iterable, cada llamada al objeto simulado retornará el " +"siguiente valor del iterable." #: ../Doc/library/unittest.mock.rst:259 msgid "A *side_effect* can be cleared by setting it to ``None``." -msgstr "" +msgstr "Un *side_effect* se puede borrar estableciéndolo en ``None``." #: ../Doc/library/unittest.mock.rst:261 msgid "" -"*return_value*: The value returned when the mock is called. By default this " -"is a new Mock (created on first access). See the :attr:`return_value` " -"attribute." +"*return_value*: The value returned when the mock is called. By default this is " +"a new Mock (created on first access). See the :attr:`return_value` attribute." msgstr "" +"*return_value*: El valor retornado cuando se llama al objeto simulado. Por " +"defecto, esta es una nueva instancia de Mock (creada en el primer acceso). " +"Consultar el atributo :attr:`return_value` para más detalles." #: ../Doc/library/unittest.mock.rst:265 msgid "" @@ -269,270 +379,378 @@ msgid "" "raise an :exc:`AttributeError`. Passing ``unsafe=True`` will allow access to " "these attributes." msgstr "" +"*unsafe*: Por defecto, si cualquier atributo comienza con *assert* o *assret* " +"se lanza una excepción :exc:`AttributeError` si se intenta acceder a ellos. " +"Pasar ``unsafe=True`` permitirá el acceso a estos atributos." #: ../Doc/library/unittest.mock.rst:271 msgid "" "*wraps*: Item for the mock object to wrap. If *wraps* is not ``None`` then " "calling the Mock will pass the call through to the wrapped object (returning " -"the real result). Attribute access on the mock will return a Mock object " -"that wraps the corresponding attribute of the wrapped object (so attempting " -"to access an attribute that doesn't exist will raise an :exc:" -"`AttributeError`)." +"the real result). Attribute access on the mock will return a Mock object that " +"wraps the corresponding attribute of the wrapped object (so attempting to " +"access an attribute that doesn't exist will raise an :exc:`AttributeError`)." msgstr "" +"*wraps*: objeto a envolver (simular) por la instancia de Mock. Si *wraps* no es " +"``None``, la llamada al objeto Mock pasa a su vez la llamada a través del " +"objeto envuelto (retornando el resultado real). Acceder a un atributo del " +"objeto simulado retornará otro objeto Mock que envuelve al atributo " +"correspondiente del objeto real envuelto (de modo que intentar acceder a un " +"atributo que no existe lanzará una excepción :exc:`AttributeError`)." #: ../Doc/library/unittest.mock.rst:278 msgid "" -"If the mock has an explicit *return_value* set then calls are not passed to " -"the wrapped object and the *return_value* is returned instead." +"If the mock has an explicit *return_value* set then calls are not passed to the " +"wrapped object and the *return_value* is returned instead." msgstr "" +"Si el objeto simulado tiene un *return_value* explícito establecido, las " +"llamadas no se pasan al objeto envuelto y *return_value* se retorna en su lugar." #: ../Doc/library/unittest.mock.rst:281 msgid "" "*name*: If the mock has a name then it will be used in the repr of the mock. " "This can be useful for debugging. The name is propagated to child mocks." msgstr "" +"*name*: Si el objeto simulado tiene un nombre, será utilizado en la " +"representación imprimible del mismo. Esto puede ser útil para la depuración. El " +"nombre se propaga a los objetos simulados hijos." #: ../Doc/library/unittest.mock.rst:285 msgid "" -"Mocks can also be called with arbitrary keyword arguments. These will be " -"used to set attributes on the mock after it is created. See the :meth:" +"Mocks can also be called with arbitrary keyword arguments. These will be used " +"to set attributes on the mock after it is created. See the :meth:" "`configure_mock` method for details." msgstr "" +"Los objetos simulados también pueden ser llamados con argumentos por palabra " +"clave arbitrarios. Estos serán utilizados para establecer atributos en el " +"objeto simulado una vez creado. Consultar el método :meth:`configure_mock` para " +"más detalles." #: ../Doc/library/unittest.mock.rst:291 msgid "Assert that the mock was called at least once." -msgstr "" +msgstr "Aserta si el objeto simulado se ha llamado al menos una vez." #: ../Doc/library/unittest.mock.rst:302 msgid "Assert that the mock was called exactly once." -msgstr "" +msgstr "Aserta si el objeto simulado se ha llamado exactamente una vez." #: ../Doc/library/unittest.mock.rst:320 msgid "" -"This method is a convenient way of asserting that the last call has been " -"made in a particular way:" +"This method is a convenient way of asserting that the last call has been made " +"in a particular way:" msgstr "" +"Este método es una manera apropiada de asertar si la última llamada se ha " +"realizado de una manera particular:" #: ../Doc/library/unittest.mock.rst:330 msgid "" "Assert that the mock was called exactly once and that that call was with the " "specified arguments." msgstr "" +"Aserta si el objeto simulado se ha llamado exactamente una vez y que esa " +"llamada se realizó con los argumentos especificados." #: ../Doc/library/unittest.mock.rst:345 msgid "assert the mock has been called with the specified arguments." msgstr "" +"aserta si el objeto simulado se ha llamado con los argumentos especificados." #: ../Doc/library/unittest.mock.rst:347 msgid "" "The assert passes if the mock has *ever* been called, unlike :meth:" -"`assert_called_with` and :meth:`assert_called_once_with` that only pass if " -"the call is the most recent one, and in the case of :meth:" -"`assert_called_once_with` it must also be the only call." +"`assert_called_with` and :meth:`assert_called_once_with` that only pass if the " +"call is the most recent one, and in the case of :meth:`assert_called_once_with` " +"it must also be the only call." msgstr "" +"La aserción pasa si el objeto simulado se ha llamado *en algún momento*, a " +"diferencia de :meth:`assert_called_with` y :meth:`assert_called_once_with`, con " +"los que sólo pasa la aserción si la llamada es la más reciente, y en el caso " +"de :meth:`assert_called_once_with` también debe ser la única llamada realizada." #: ../Doc/library/unittest.mock.rst:360 msgid "" "assert the mock has been called with the specified calls. The :attr:" "`mock_calls` list is checked for the calls." msgstr "" +"aserta si el objeto simulado se ha llamado con las llamadas especificadas. La " +"lista :attr:`mock_calls` se compara con la lista de llamadas." #: ../Doc/library/unittest.mock.rst:363 msgid "" -"If *any_order* is false then the calls must be sequential. There can be " -"extra calls before or after the specified calls." +"If *any_order* is false then the calls must be sequential. There can be extra " +"calls before or after the specified calls." msgstr "" +"Si *any_order* es falso entonces las llamadas deben ser secuenciales. No puede " +"haber llamadas adicionales antes o después de las llamadas especificadas." #: ../Doc/library/unittest.mock.rst:367 msgid "" "If *any_order* is true then the calls can be in any order, but they must all " "appear in :attr:`mock_calls`." msgstr "" +"Si *any_order* es verdadero, las llamadas pueden estar en cualquier orden, pero " +"deben aparecer todas en :attr:`mock_calls`." #: ../Doc/library/unittest.mock.rst:382 msgid "Assert the mock was never called." -msgstr "" +msgstr "Aserta si el mock nunca fue llamado." #: ../Doc/library/unittest.mock.rst:397 msgid "The reset_mock method resets all the call attributes on a mock object:" msgstr "" +"El método *reset_mock* restablece todos los atributos de llamada en un objeto " +"simulado:" #: ../Doc/library/unittest.mock.rst:407 msgid "Added two keyword only argument to the reset_mock function." -msgstr "" +msgstr "Añadidos dos argumentos por palabra clave a la función *reset_mock*." #: ../Doc/library/unittest.mock.rst:410 msgid "" -"This can be useful where you want to make a series of assertions that reuse " -"the same object. Note that :meth:`reset_mock` *doesn't* clear the return " -"value, :attr:`side_effect` or any child attributes you have set using normal " -"assignment by default. In case you want to reset *return_value* or :attr:" -"`side_effect`, then pass the corresponding parameter as ``True``. Child " -"mocks and the return value mock (if any) are reset as well." -msgstr "" +"This can be useful where you want to make a series of assertions that reuse the " +"same object. Note that :meth:`reset_mock` *doesn't* clear the return value, :" +"attr:`side_effect` or any child attributes you have set using normal assignment " +"by default. In case you want to reset *return_value* or :attr:`side_effect`, " +"then pass the corresponding parameter as ``True``. Child mocks and the return " +"value mock (if any) are reset as well." +msgstr "" +"Esto puede ser útil cuando se quiere hacer una serie de aserciones que " +"reutilizan el mismo objeto. Ten en cuenta que por defecto :meth:`reset_mock` " +"*no* borra el valor de retorno, :attr:`side_effect` o cualquier atributo hijo " +"que hayas establecido mediante asignación normal. En caso de que quieras " +"restablecer *return_value* o :attr:`side_effect`, debes pasar el parámetro " +"correspondiente como ``True``. Los objetos simulados hijos y el objeto simulado " +"que conforma el valor de retorno (si los hay) se restablecen también." #: ../Doc/library/unittest.mock.rst:418 msgid "*return_value*, and :attr:`side_effect` are keyword only argument." msgstr "" +"*return_value* y :attr:`side_effect` son argumentos por palabra clave " +"exclusivamente." #: ../Doc/library/unittest.mock.rst:424 msgid "" -"Add a spec to a mock. *spec* can either be an object or a list of strings. " -"Only attributes on the *spec* can be fetched as attributes from the mock." +"Add a spec to a mock. *spec* can either be an object or a list of strings. Only " +"attributes on the *spec* can be fetched as attributes from the mock." msgstr "" +"Agrega una especificación a un objeto simulado. *spec* puede ser un objeto o " +"una lista de cadenas de caracteres. Sólo los atributos presentes en *spec* " +"pueden ser obtenidos desde el objeto simulado." #: ../Doc/library/unittest.mock.rst:428 msgid "If *spec_set* is true then only attributes on the spec can be set." msgstr "" +"Si *spec_set* es verdadero, solo los atributos de la especificación pueden ser " +"establecidos." #: ../Doc/library/unittest.mock.rst:433 msgid "" -"Attach a mock as an attribute of this one, replacing its name and parent. " -"Calls to the attached mock will be recorded in the :attr:`method_calls` and :" -"attr:`mock_calls` attributes of this one." +"Attach a mock as an attribute of this one, replacing its name and parent. Calls " +"to the attached mock will be recorded in the :attr:`method_calls` and :attr:" +"`mock_calls` attributes of this one." msgstr "" +"Adjunta otro objeto simulado como un atributo de la instancia actual, " +"substituyendo su nombre y su padre. Las llamadas al objeto simulado adjuntado " +"se registrarán en los atributos :attr:`method_calls` y :attr:`mock_calls` del " +"padre." #: ../Doc/library/unittest.mock.rst:440 msgid "Set attributes on the mock through keyword arguments." msgstr "" +"Establece los atributos del objeto simulado por medio de argumentos por palabra " +"clave." #: ../Doc/library/unittest.mock.rst:442 msgid "" -"Attributes plus return values and side effects can be set on child mocks " -"using standard dot notation and unpacking a dictionary in the method call:" +"Attributes plus return values and side effects can be set on child mocks using " +"standard dot notation and unpacking a dictionary in the method call:" msgstr "" +"Los atributos, los valores de retorno y los efectos de colaterales se pueden " +"configurar en los objetos simulados hijos usando la notación de punto estándar " +"y desempaquetando un diccionario en la llamada al método:" #: ../Doc/library/unittest.mock.rst:456 msgid "The same thing can be achieved in the constructor call to mocks:" msgstr "" +"Lo mismo se puede lograr en la llamada al constructor de los objetos simulados:" #: ../Doc/library/unittest.mock.rst:469 msgid "" -":meth:`configure_mock` exists to make it easier to do configuration after " -"the mock has been created." +":meth:`configure_mock` exists to make it easier to do configuration after the " +"mock has been created." msgstr "" +":meth:`configure_mock` existe con el fin de facilitar la configuración después " +"de que el objeto simulado haya sido creado." #: ../Doc/library/unittest.mock.rst:475 msgid "" ":class:`Mock` objects limit the results of ``dir(some_mock)`` to useful " -"results. For mocks with a *spec* this includes all the permitted attributes " -"for the mock." +"results. For mocks with a *spec* this includes all the permitted attributes for " +"the mock." msgstr "" +"Los objetos :class:`Mock` limitan los resultados de ``dir(some_mock)`` a " +"resultados útiles. Para los objetos simulados con una especificación (*spec*) " +"esto incluye todos los atributos permitidos para el mismo." #: ../Doc/library/unittest.mock.rst:479 msgid "" -"See :data:`FILTER_DIR` for what this filtering does, and how to switch it " -"off." +"See :data:`FILTER_DIR` for what this filtering does, and how to switch it off." msgstr "" +"Consultar :data:`FILTER_DIR` para conocer que hace este filtrado y la forma de " +"desactivarlo." #: ../Doc/library/unittest.mock.rst:485 msgid "" -"Create the child mocks for attributes and return value. By default child " -"mocks will be the same type as the parent. Subclasses of Mock may want to " -"override this to customize the way child mocks are made." +"Create the child mocks for attributes and return value. By default child mocks " +"will be the same type as the parent. Subclasses of Mock may want to override " +"this to customize the way child mocks are made." msgstr "" +"Crea los objetos simulados hijos para los atributos y el valor de retorno. Por " +"defecto los objetos simulados hijos serán del mismo tipo que el padre. Las " +"subclases de Mock pueden redefinir este método para personalizar la forma en la " +"que se construye el objeto simulado hijo." #: ../Doc/library/unittest.mock.rst:490 msgid "" "For non-callable mocks the callable variant will be used (rather than any " "custom subclass)." msgstr "" +"Para objetos simulados no invocables la variante invocable será utilizada (en " +"lugar de cualquier subclase personalizada)." #: ../Doc/library/unittest.mock.rst:496 msgid "A boolean representing whether or not the mock object has been called:" -msgstr "" +msgstr "Un booleano que representa si el objeto simulado ha sido llamado o no:" #: ../Doc/library/unittest.mock.rst:507 msgid "An integer telling you how many times the mock object has been called:" -msgstr "" +msgstr "Un entero que le dice cuántas veces el objeto simulado ha sido llamado:" #: ../Doc/library/unittest.mock.rst:519 msgid "Set this to configure the value returned by calling the mock:" msgstr "" +"Establece éste atributo para configurar el valor a retornar cuando se llame al " +"objeto simulado:" #: ../Doc/library/unittest.mock.rst:526 msgid "" "The default return value is a mock object and you can configure it in the " "normal way:" msgstr "" +"El valor de retorno por defecto es un objeto simulado y se puede configurar de " +"forma habitual:" #: ../Doc/library/unittest.mock.rst:535 msgid ":attr:`return_value` can also be set in the constructor:" msgstr "" +":attr:`return_value` también se puede establecer directamente en el constructor:" #: ../Doc/library/unittest.mock.rst:546 msgid "" -"This can either be a function to be called when the mock is called, an " -"iterable or an exception (class or instance) to be raised." +"This can either be a function to be called when the mock is called, an iterable " +"or an exception (class or instance) to be raised." msgstr "" +"Este atributo puede ser una función a ser llamada cuando se llame al objeto " +"simulado, un iterable o una excepción (clase o instancia) para ser lanzada." #: ../Doc/library/unittest.mock.rst:549 msgid "" -"If you pass in a function it will be called with same arguments as the mock " -"and unless the function returns the :data:`DEFAULT` singleton the call to " -"the mock will then return whatever the function returns. If the function " -"returns :data:`DEFAULT` then the mock will return its normal value (from " -"the :attr:`return_value`)." +"If you pass in a function it will be called with same arguments as the mock and " +"unless the function returns the :data:`DEFAULT` singleton the call to the mock " +"will then return whatever the function returns. If the function returns :data:" +"`DEFAULT` then the mock will return its normal value (from the :attr:" +"`return_value`)." msgstr "" +"Si pasas una función, será llamada con los mismos argumentos que el objeto " +"simulado y, a menos que la función retorne el singleton :data:`DEFAULT`, la " +"llamada al objeto simulado retornará lo mismo que retorna la función. En " +"cambio, si la función retorna :data:`DEFAULT` el objeto simulado retornará su " +"valor normal (el del atributo :attr:`return_value`)." #: ../Doc/library/unittest.mock.rst:555 msgid "" -"If you pass in an iterable, it is used to retrieve an iterator which must " -"yield a value on every call. This value can either be an exception instance " -"to be raised, or a value to be returned from the call to the mock (:data:" -"`DEFAULT` handling is identical to the function case)." +"If you pass in an iterable, it is used to retrieve an iterator which must yield " +"a value on every call. This value can either be an exception instance to be " +"raised, or a value to be returned from the call to the mock (:data:`DEFAULT` " +"handling is identical to the function case)." msgstr "" +"Si pasas un iterable, se utiliza para obtener un iterador a partir del mismo " +"que debe producir un valor en cada llamada. Este valor puede ser una instancia " +"de la excepción a ser lanzada o un valor a retornar al llamar al objeto " +"simulado (el manejo de :data:`DEFAULT` es igual que en el caso de pasar una " +"función)." #: ../Doc/library/unittest.mock.rst:560 msgid "" -"An example of a mock that raises an exception (to test exception handling of " -"an API):" +"An example of a mock that raises an exception (to test exception handling of an " +"API):" msgstr "" +"Un ejemplo de un objeto simulado que genera una excepción (para probar el " +"manejo de excepciones de una API):" #: ../Doc/library/unittest.mock.rst:570 msgid "Using :attr:`side_effect` to return a sequence of values:" -msgstr "" +msgstr "Usando :attr:`side_effect` para retornar una secuencia de valores:" #: ../Doc/library/unittest.mock.rst:577 msgid "Using a callable:" -msgstr "" +msgstr "Usando un objeto invocable:" #: ../Doc/library/unittest.mock.rst:587 msgid "" -":attr:`side_effect` can be set in the constructor. Here's an example that " -"adds one to the value the mock is called with and returns it:" +":attr:`side_effect` can be set in the constructor. Here's an example that adds " +"one to the value the mock is called with and returns it:" msgstr "" +":attr:`side_effect` se puede establecer en el constructor. Aquí hay un ejemplo " +"que suma uno al valor del objeto simulado llamado y lo retorna:" #: ../Doc/library/unittest.mock.rst:597 msgid "Setting :attr:`side_effect` to ``None`` clears it:" -msgstr "" +msgstr "Establecer :attr:`side_effect` en ``None`` lo desactiva:" #: ../Doc/library/unittest.mock.rst:611 msgid "" -"This is either ``None`` (if the mock hasn't been called), or the arguments " -"that the mock was last called with. This will be in the form of a tuple: the " -"first member, which can also be accessed through the ``args`` property, is " -"any ordered arguments the mock was called with (or an empty tuple) and the " -"second member, which can also be accessed through the ``kwargs`` property, " -"is any keyword arguments (or an empty dictionary)." -msgstr "" +"This is either ``None`` (if the mock hasn't been called), or the arguments that " +"the mock was last called with. This will be in the form of a tuple: the first " +"member, which can also be accessed through the ``args`` property, is any " +"ordered arguments the mock was called with (or an empty tuple) and the second " +"member, which can also be accessed through the ``kwargs`` property, is any " +"keyword arguments (or an empty dictionary)." +msgstr "" +"Este atributo es ``None`` (si el objetos simulado no ha sido llamado) o los " +"argumentos con los que se llamó por última vez. En este último caso, será una " +"tupla con dos elementos: el primer miembro, que también es accesible a través " +"de la propiedad ``args``, son los argumentos posicionales con los que el objeto " +"simulado se llamó (o una tupla vacía si no se pasó ninguno) y el segundo " +"miembro, que también es accesible mediante la propiedad ``kwargs``, es " +"cualquier argumento por palabra clave (o un diccionario vacío si no se pasó " +"ninguno)." #: ../Doc/library/unittest.mock.rst:644 msgid "" ":attr:`call_args`, along with members of the lists :attr:`call_args_list`, :" -"attr:`method_calls` and :attr:`mock_calls` are :data:`call` objects. These " -"are tuples, so they can be unpacked to get at the individual arguments and " -"make more complex assertions. See :ref:`calls as tuples `." +"attr:`method_calls` and :attr:`mock_calls` are :data:`call` objects. These are " +"tuples, so they can be unpacked to get at the individual arguments and make " +"more complex assertions. See :ref:`calls as tuples `." msgstr "" +"El atributo :attr:`call_args`, junto con los miembros de las listas :attr:" +"`call_args_list`, :attr:`method_calls` y :attr:`mock_calls` son objetos :data:" +"`call`. Estos son tuplas, con la finalidad de que puedan ser desempaquetadas " +"para acceder a los argumentos individuales y hacer aserciones más complejas. " +"Consultar :ref:`llamadas como tuplas ` para más información." #: ../Doc/library/unittest.mock.rst:653 msgid "" "This is a list of all the calls made to the mock object in sequence (so the " -"length of the list is the number of times it has been called). Before any " -"calls have been made it is an empty list. The :data:`call` object can be " -"used for conveniently constructing lists of calls to compare with :attr:" -"`call_args_list`." +"length of the list is the number of times it has been called). Before any calls " +"have been made it is an empty list. The :data:`call` object can be used for " +"conveniently constructing lists of calls to compare with :attr:`call_args_list`." msgstr "" +"Este argumento es una lista de todas las llamadas consecutivas realizadas al " +"objeto simulado (por lo que la longitud de la lista es el número de veces que " +"se ha llamado). Previamente a que se hayan realizado llamadas es una lista " +"vacía. El objeto :data:`call` se puede utilizar para construir convenientemente " +"las listas de llamadas a comparar con :attr:`call_args_list`." #: ../Doc/library/unittest.mock.rst:669 msgid "" @@ -540,53 +758,77 @@ msgid "" "unpacked as tuples to get at the individual arguments. See :ref:`calls as " "tuples `." msgstr "" +"Los miembros de :attr:`call_args_list` son objetos :data:`call`. Estos pueden " +"ser desempaquetados como tuplas para acceder a los argumentos individuales. " +"Consultar :ref:`llamadas como tuplas ` para más información." #: ../Doc/library/unittest.mock.rst:676 msgid "" -"As well as tracking calls to themselves, mocks also track calls to methods " -"and attributes, and *their* methods and attributes:" +"As well as tracking calls to themselves, mocks also track calls to methods and " +"attributes, and *their* methods and attributes:" msgstr "" +"Igual que realizan un seguimiento de las llamadas hechas a sí mismos, los " +"objetos simulados también realizan un seguimiento a *sus* métodos y atributos, " +"así como de las llamadas hechas a los mismos:" #: ../Doc/library/unittest.mock.rst:687 msgid "" -"Members of :attr:`method_calls` are :data:`call` objects. These can be " -"unpacked as tuples to get at the individual arguments. See :ref:`calls as " -"tuples `." +"Members of :attr:`method_calls` are :data:`call` objects. These can be unpacked " +"as tuples to get at the individual arguments. See :ref:`calls as tuples `." msgstr "" +"Los miembros de :attr:`method_calls` son objetos :data:`call`. Estos pueden ser " +"desempaquetados como tuplas para acceder a los atributos individuales. " +"Consultar :ref:`llamadas como tuplas ` para más información." #: ../Doc/library/unittest.mock.rst:694 msgid "" -":attr:`mock_calls` records *all* calls to the mock object, its methods, " -"magic methods *and* return value mocks." +":attr:`mock_calls` records *all* calls to the mock object, its methods, magic " +"methods *and* return value mocks." msgstr "" +":attr:`mock_calls` registra *todas* las llamadas al objeto simulado, sus " +"métodos, métodos mágicos *y* objetos simulados del valor de retorno." #: ../Doc/library/unittest.mock.rst:712 msgid "" -"Members of :attr:`mock_calls` are :data:`call` objects. These can be " -"unpacked as tuples to get at the individual arguments. See :ref:`calls as " -"tuples `." +"Members of :attr:`mock_calls` are :data:`call` objects. These can be unpacked " +"as tuples to get at the individual arguments. See :ref:`calls as tuples `." msgstr "" +"Los miembros de :attr:`mock_calls` son objetos :data:`call`. Estos pueden ser " +"desempaquetados como tuplas para acceder a los argumentos individuales. " +"Consultar :ref:`llamadas como tuplas ` para más información." #: ../Doc/library/unittest.mock.rst:718 msgid "" -"The way :attr:`mock_calls` are recorded means that where nested calls are " -"made, the parameters of ancestor calls are not recorded and so will always " -"compare equal:" +"The way :attr:`mock_calls` are recorded means that where nested calls are made, " +"the parameters of ancestor calls are not recorded and so will always compare " +"equal:" msgstr "" +"La forma como se registra el atributo :attr:`mock_calls` implica que cuando se " +"realizan llamadas anidadas los parámetros de las llamadas previas no se " +"registran, por lo que siempre resultan iguales al comparar:" #: ../Doc/library/unittest.mock.rst:732 msgid "" -"Normally the :attr:`__class__` attribute of an object will return its type. " -"For a mock object with a :attr:`spec`, ``__class__`` returns the spec class " +"Normally the :attr:`__class__` attribute of an object will return its type. For " +"a mock object with a :attr:`spec`, ``__class__`` returns the spec class " "instead. This allows mock objects to pass :func:`isinstance` tests for the " "object they are replacing / masquerading as:" msgstr "" +"Normalmente el atributo de un objeto :attr:`__class__` retornará su tipo. Para " +"un objeto simulado con un :attr:`spec`, ``__class__`` retorna la clase " +"especificada en su lugar. Esto permite a los objetos simulados pasar los test " +"de :func:`isinstance` para el objeto que están reemplazando / enmascarando:" #: ../Doc/library/unittest.mock.rst:741 msgid "" ":attr:`__class__` is assignable to, this allows a mock to pass an :func:" "`isinstance` check without forcing you to use a spec:" msgstr "" +"El atributo :attr:`__class__` es asignable al mismo, esto permite al objeto " +"simulado pasar una verificación de :func:`isinstance` sin verse forzado a " +"utilizar una especificación:" #: ../Doc/library/unittest.mock.rst:751 msgid "" @@ -594,26 +836,39 @@ msgid "" "same meaning of :class:`Mock`, with the exception of *return_value* and " "*side_effect* which have no meaning on a non-callable mock." msgstr "" +"Una versión no invocable de :class:`Mock`. Los parámetros del constructor " +"tienen el mismo significado que en :class:`Mock`, con la excepción de " +"*return_value* y *side_effect* que no tienen sentido en un objeto simulado no " +"invocable." #: ../Doc/library/unittest.mock.rst:755 msgid "" "Mock objects that use a class or an instance as a :attr:`spec` or :attr:" "`spec_set` are able to pass :func:`isinstance` tests:" msgstr "" +"Los objetos simulados que usan una clase o una instancia como :attr:`spec` o :" +"attr:`spec_set` son capaces de pasar los test de :func:`isinstance`:" #: ../Doc/library/unittest.mock.rst:765 msgid "" "The :class:`Mock` classes have support for mocking magic methods. See :ref:" "`magic methods ` for the full details." msgstr "" +"Las clases :class:`Mock` tienen soporte para simular los métodos mágicos. " +"Consultar los :ref:`métodos mágicos ` para ver los detalles." #: ../Doc/library/unittest.mock.rst:768 msgid "" "The mock classes and the :func:`patch` decorators all take arbitrary keyword " -"arguments for configuration. For the :func:`patch` decorators the keywords " -"are passed to the constructor of the mock being created. The keyword " -"arguments are for configuring attributes of the mock:" +"arguments for configuration. For the :func:`patch` decorators the keywords are " +"passed to the constructor of the mock being created. The keyword arguments are " +"for configuring attributes of the mock:" msgstr "" +"Las clases simuladas y los decoradores :func:`patch` aceptan todos argumentos " +"por palabra clave arbitrarios para la configuración. En los decoradores :func:" +"`patch` los argumentos por palabra clave se pasan al constructor del objeto " +"simulado creado. Estos argumentos se usan para configurar los atributos del " +"propio objeto simulado:" #: ../Doc/library/unittest.mock.rst:779 msgid "" @@ -621,6 +876,9 @@ msgid "" "using dotted notation. As you can't use dotted names directly in a call you " "have to create a dictionary and unpack it using ``**``:" msgstr "" +"Tanto el valor de retorno como el efecto colateral del objeto simulado. Dado " +"que no se puede utilizar notación de punto directamente en una llamada, se " +"tiene que crear un diccionario y desempaquetarlo usando ``**``:" #: ../Doc/library/unittest.mock.rst:794 msgid "" @@ -629,6 +887,11 @@ msgid "" "mock. Therefore, it can match the actual call's arguments regardless of " "whether they were passed positionally or by name::" msgstr "" +"Un objeto simulado invocable que fue creado con un *spec* (o un *spec_set*) " +"introspeccionará la firma del objeto de la especificación en el momento de " +"emparejar las llamadas al objeto simulado. Esto le permite hacer coincidir sus " +"argumentos con los argumentos de la llamada real, independientemente de si se " +"pasaron por posición o por por nombre:" #: ../Doc/library/unittest.mock.rst:807 msgid "" @@ -637,10 +900,16 @@ msgid "" "assert_any_call`. When :ref:`auto-speccing`, it will also apply to method " "calls on the mock object." msgstr "" +"Esto se aplica a :meth:`~Mock.assert_called_with`, :meth:`~Mock." +"assert_called_once_with`, :meth:`~Mock.assert_has_calls` y :meth:`~Mock." +"assert_any_call`. Cuando se especifica :ref:`auto-speccing`, también se " +"aplicará a las llamadas de los métodos del objeto simulado." #: ../Doc/library/unittest.mock.rst:812 msgid "Added signature introspection on specced and autospecced mock objects." msgstr "" +"Añadida introspección de firma en objetos simulados especificados y " +"autoespecificados." #: ../Doc/library/unittest.mock.rst:818 msgid "" @@ -648,12 +917,19 @@ msgid "" "class:`PropertyMock` provides :meth:`__get__` and :meth:`__set__` methods so " "you can specify a return value when it is fetched." msgstr "" +"Un objeto simulado destinado a ser utilizado en una clase como una propiedad, u " +"otro descriptor. La clase :class:`PropertyMock` proporciona los métodos :meth:" +"`__get__` y :meth:`__set__`, por lo que puedes especificar un valor de retorno " +"para cuando su valor es requerido." #: ../Doc/library/unittest.mock.rst:822 msgid "" -"Fetching a :class:`PropertyMock` instance from an object calls the mock, " -"with no args. Setting it calls the mock with the value being set. ::" +"Fetching a :class:`PropertyMock` instance from an object calls the mock, with " +"no args. Setting it calls the mock with the value being set. ::" msgstr "" +"La obtención de una instancia desde un objeto :class:`PropertyMock` ocasiona " +"una llamada al objeto simulado, sin argumentos. Establecer su valor también " +"llama al objeto simulado, con el valor a establecer como argumento. ::" #: ../Doc/library/unittest.mock.rst:843 msgid "" @@ -661,6 +937,9 @@ msgid "" "class:`PropertyMock` to a mock object. Instead you can attach it to the mock " "type object::" msgstr "" +"Debido a la forma en que se almacenan los atributos simulados, no es posible " +"conectar directamente un :class:`PropertyMock` a un objeto simulado. En su " +"lugar se puede conectar al tipo (type) del objeto simulado:" #: ../Doc/library/unittest.mock.rst:857 msgid "" @@ -668,24 +947,32 @@ msgid "" "behave so the object is recognized as an async function, and the result of a " "call is an awaitable." msgstr "" +"Una versión asíncrona de :class:`Mock`. El objeto :class:`AsyncMock` se " +"comportará de tal modo que el objeto es reconocido como una función asíncrona y " +"el resultado de su llamada es un objeto 'esperable' (awaitable)." #: ../Doc/library/unittest.mock.rst:867 msgid "" "The result of ``mock()`` is an async function which will have the outcome of " "``side_effect`` or ``return_value`` after it has been awaited:" msgstr "" +"El resultado de ``mock()`` es una función asíncrona que proporcionará el " +"resultado de ``side_effect`` o de ``return_value`` después de haber sido " +"\"esperada\" (awaited):" #: ../Doc/library/unittest.mock.rst:870 msgid "" -"if ``side_effect`` is a function, the async function will return the result " -"of that function," +"if ``side_effect`` is a function, the async function will return the result of " +"that function," msgstr "" +"si ``side_effect`` es una función, la función asíncrona retornará el resultado " +"de esa función," #: ../Doc/library/unittest.mock.rst:872 msgid "" -"if ``side_effect`` is an exception, the async function will raise the " -"exception," +"if ``side_effect`` is an exception, the async function will raise the exception," msgstr "" +"si ``side_effect`` es una excepción, la función asíncrona lanza la excepción," #: ../Doc/library/unittest.mock.rst:874 msgid "" @@ -693,6 +980,9 @@ msgid "" "value of the iterable, however, if the sequence of result is exhausted, " "``StopAsyncIteration`` is raised immediately," msgstr "" +"si ``side_effect`` es un iterable, la función asíncrona retornará el siguiente " +"valor del iterable, sin embargo, si se agota la secuencia de resultados, se " +"lanza una excepción ``StopAsyncIteration`` inmediatamente," #: ../Doc/library/unittest.mock.rst:877 msgid "" @@ -700,12 +990,18 @@ msgid "" "defined by ``return_value``, hence, by default, the async function returns a " "new :class:`AsyncMock` object." msgstr "" +"si ``side_effect`` no está definido, la función asíncrona retornará el valor " +"definido por ``return_value``, por lo tanto, la función asíncrona retorna un " +"nuevo objeto :class:`AsyncMock` por defecto." #: ../Doc/library/unittest.mock.rst:882 msgid "" "Setting the *spec* of a :class:`Mock` or :class:`MagicMock` to an async " "function will result in a coroutine object being returned after calling." msgstr "" +"Establecer el argumento *spec* de un objeto :class:`Mock` o :class:`MagicMock` " +"en una función asíncrona resultará en que un objeto corrutina será retornado " +"después de la llamada." #: ../Doc/library/unittest.mock.rst:894 msgid "" @@ -716,63 +1012,89 @@ msgid "" "or :class:`Mock` (if the parent mock is :class:`Mock`). All asynchronous " "functions will be :class:`AsyncMock`." msgstr "" +"Establecer el argumento *spec* de un objeto :class:`Mock`, :class:`MagicMock` " +"o :class:`AsyncMock` en una clase que tiene simultáneamente funciones " +"asíncronas y síncronas hará que se detecten automáticamente las funciones " +"sincrónicas y las establecerá como :class:`MagicMock` (si el objeto simulado " +"padre es :class:`AsyncMock` o :class:`MagicMock`) o :class:`Mock` (si el objeto " +"simulado padre es :class:`Mock`) . Todas las funciones asíncronas serán :class:" +"`AsyncMock`." #: ../Doc/library/unittest.mock.rst:922 msgid "" -"Assert that the mock was awaited at least once. Note that this is separate " -"from the object having been called, the ``await`` keyword must be used:" +"Assert that the mock was awaited at least once. Note that this is separate from " +"the object having been called, the ``await`` keyword must be used:" msgstr "" +"Aserta si el objeto simulado fue \"esperado\" (awaited) al menos una vez. Ten " +"en cuenta que independientemente del objeto que ha sido llamado, la palabra " +"clave ``await`` debe ser utilizada:" #: ../Doc/library/unittest.mock.rst:941 msgid "Assert that the mock was awaited exactly once." msgstr "" +"Aserta si que el objeto simulado fue 'esperado' (awaited) exactamente una vez." #: ../Doc/library/unittest.mock.rst:957 msgid "Assert that the last await was with the specified arguments." -msgstr "" +msgstr "Aserta si la última 'espera' fue con los argumentos especificados." #: ../Doc/library/unittest.mock.rst:974 msgid "" -"Assert that the mock was awaited exactly once and with the specified " -"arguments." +"Assert that the mock was awaited exactly once and with the specified arguments." msgstr "" +"Aserta si que el objeto simulado se ha \"esperado\" (awaited) exactamente una " +"vez y con los argumentos especificados." #: ../Doc/library/unittest.mock.rst:991 msgid "Assert the mock has ever been awaited with the specified arguments." msgstr "" +"Aserta si el objeto simulado nunca se ha \"esperado\" (awaited) con los " +"argumentos especificados." #: ../Doc/library/unittest.mock.rst:1007 msgid "" "Assert the mock has been awaited with the specified calls. The :attr:" "`await_args_list` list is checked for the awaits." msgstr "" +"Aserta si el objeto simulado ha sido 'esperado' (awaited) con las llamadas " +"especificadas. La lista :attr:`await_args_list` es comprobada por las " +"'esperas' (awaits)." #: ../Doc/library/unittest.mock.rst:1010 msgid "" -"If *any_order* is false then the awaits must be sequential. There can be " -"extra calls before or after the specified awaits." +"If *any_order* is false then the awaits must be sequential. There can be extra " +"calls before or after the specified awaits." msgstr "" +"Si *any_order* es falso entonces las 'esperas' (awaits) deben ser secuenciales. " +"No puede haber llamadas adicionales antes o después de las 'esperas' (awaits) " +"especificados." #: ../Doc/library/unittest.mock.rst:1014 msgid "" -"If *any_order* is true then the awaits can be in any order, but they must " -"all appear in :attr:`await_args_list`." +"If *any_order* is true then the awaits can be in any order, but they must all " +"appear in :attr:`await_args_list`." msgstr "" +"Si *any_order* es verdadero, entonces las 'esperas' (awaits) pueden estar en " +"cualquier orden, pero deben aparecer todos en :attr:`await_args_list`." #: ../Doc/library/unittest.mock.rst:1034 msgid "Assert that the mock was never awaited." -msgstr "" +msgstr "Aserta si el objeto simulado nunca ha sido 'esperado' (awaited)." #: ../Doc/library/unittest.mock.rst:1041 msgid "" "See :func:`Mock.reset_mock`. Also sets :attr:`await_count` to 0, :attr:" "`await_args` to None, and clears the :attr:`await_args_list`." msgstr "" +"Consultar :func:`Mock.reset_mock` para más detalles. También establece :attr:" +"`await_count` a 0, :attr:`await_args` a None y borra :attr:`await_args_list`." #: ../Doc/library/unittest.mock.rst:1046 msgid "" "An integer keeping track of how many times the mock object has been awaited." msgstr "" +"Un registro entero de cuántas veces se ha 'esperado' (awaited) el objeto de " +"simulado." #: ../Doc/library/unittest.mock.rst:1061 msgid "" @@ -780,6 +1102,9 @@ msgid "" "that the mock was last awaited with. Functions the same as :attr:`Mock." "call_args`." msgstr "" +"Este atributo es ``None`` (si el objeto simulado no se ha 'esperado') o los " +"argumentos con los que fue 'esperado' la última vez. Su funcionamiento es " +"idéntico que el de :attr:`Mock.call_args`." #: ../Doc/library/unittest.mock.rst:1079 msgid "" @@ -787,101 +1112,143 @@ msgid "" "length of the list is the number of times it has been awaited). Before any " "awaits have been made it is an empty list." msgstr "" +"Es una lista de todas las 'esperas' (awaits) realizadas en el objeto simulado " +"de forma secuencial (por lo que la longitud de la lista es el número de veces " +"que se ha 'esperado'). Si no se han realizado 'esperas' (awaits) previas es una " +"lista vacía." #: ../Doc/library/unittest.mock.rst:1098 msgid "Calling" -msgstr "" +msgstr "Llamar a los objetos simulados" #: ../Doc/library/unittest.mock.rst:1100 msgid "" "Mock objects are callable. The call will return the value set as the :attr:" -"`~Mock.return_value` attribute. The default return value is a new Mock " -"object; it is created the first time the return value is accessed (either " -"explicitly or by calling the Mock) - but it is stored and the same one " -"returned each time." +"`~Mock.return_value` attribute. The default return value is a new Mock object; " +"it is created the first time the return value is accessed (either explicitly or " +"by calling the Mock) - but it is stored and the same one returned each time." msgstr "" +"Los objetos Mock son invocables. La llamada a uno retornará el valor " +"establecido en el atributo :attr:`~Mock.return_value`. El valor de retorno por " +"defecto es un nuevo objeto Mock, el cual se crea la primera vez que se accede " +"al valor de retorno (ya sea explícitamente o llamando al objeto Mock). Una vez " +"creado, se almacena y el mismo objeto es retornado cada vez que se solicita." #: ../Doc/library/unittest.mock.rst:1106 msgid "" -"Calls made to the object will be recorded in the attributes like :attr:" -"`~Mock.call_args` and :attr:`~Mock.call_args_list`." +"Calls made to the object will be recorded in the attributes like :attr:`~Mock." +"call_args` and :attr:`~Mock.call_args_list`." msgstr "" +"Las llamadas realizadas al objeto serán registradas en los atributos :attr:" +"`~Mock.call_args` y :attr:`~Mock.call_args_list`." #: ../Doc/library/unittest.mock.rst:1109 msgid "" -"If :attr:`~Mock.side_effect` is set then it will be called after the call " -"has been recorded, so if :attr:`side_effect` raises an exception the call is " -"still recorded." +"If :attr:`~Mock.side_effect` is set then it will be called after the call has " +"been recorded, so if :attr:`side_effect` raises an exception the call is still " +"recorded." msgstr "" +"Si :attr:`~Mock.side_effect` se establece, será llamado después de que la " +"llamada haya sido registrada, por lo que la llamada se registra aunque :attr:" +"`side_effect` genere una excepción." #: ../Doc/library/unittest.mock.rst:1113 msgid "" -"The simplest way to make a mock raise an exception when called is to make :" -"attr:`~Mock.side_effect` an exception class or instance:" +"The simplest way to make a mock raise an exception when called is to make :attr:" +"`~Mock.side_effect` an exception class or instance:" msgstr "" +"La forma más sencilla de hacer un objeto simulado lance de una excepción cuando " +"sea llamado es establecer su atributo :attr:`~Mock.side_effect` como una clase " +"o instancia de excepción:" #: ../Doc/library/unittest.mock.rst:1131 msgid "" "If :attr:`side_effect` is a function then whatever that function returns is " -"what calls to the mock return. The :attr:`side_effect` function is called " -"with the same arguments as the mock. This allows you to vary the return " -"value of the call dynamically, based on the input:" +"what calls to the mock return. The :attr:`side_effect` function is called with " +"the same arguments as the mock. This allows you to vary the return value of the " +"call dynamically, based on the input:" msgstr "" +"Si :attr:`side_effect` es una función, la llamada al objeto simulado retornará " +"lo sea que esta función retorne. La función estableceida en :attr:`side_effect` " +"se llama con los mismos argumentos con los que el objeto simulado ha sido " +"llamado. Esto te permite variar el valor de retorno de la llamada " +"dinámicamente, en función de la entrada:" #: ../Doc/library/unittest.mock.rst:1147 msgid "" -"If you want the mock to still return the default return value (a new mock), " -"or any set return value, then there are two ways of doing this. Either " -"return :attr:`mock.return_value` from inside :attr:`side_effect`, or return :" -"data:`DEFAULT`:" +"If you want the mock to still return the default return value (a new mock), or " +"any set return value, then there are two ways of doing this. Either return :" +"attr:`mock.return_value` from inside :attr:`side_effect`, or return :data:" +"`DEFAULT`:" msgstr "" +"Si se desea que el objeto simulado aún retorne el valor por defecto (un nuevo " +"objeto simulado), o cualquier valor de retorno establecido, entonces existen " +"dos maneras de proceder. Se puede retornar tanto el atributo :attr:`mock." +"return_value` desde :attr:`side_effect` , como :data:`DEFAULT`:" #: ../Doc/library/unittest.mock.rst:1166 msgid "" -"To remove a :attr:`side_effect`, and return to the default behaviour, set " -"the :attr:`side_effect` to ``None``:" +"To remove a :attr:`side_effect`, and return to the default behaviour, set the :" +"attr:`side_effect` to ``None``:" msgstr "" +"Para eliminar un :attr:`side_effect`, volviendo al comportamiento " +"predeterminado, establece el atributo :attr:`side_effect` en ``None``:" #: ../Doc/library/unittest.mock.rst:1180 msgid "" -"The :attr:`side_effect` can also be any iterable object. Repeated calls to " -"the mock will return values from the iterable (until the iterable is " -"exhausted and a :exc:`StopIteration` is raised):" +"The :attr:`side_effect` can also be any iterable object. Repeated calls to the " +"mock will return values from the iterable (until the iterable is exhausted and " +"a :exc:`StopIteration` is raised):" msgstr "" +"El atributo :attr:`side_effect` también puede ser cualquier objeto iterable. En " +"este caso, las llamadas repetidas al objeto simulado irán retornando valores " +"del iterable (hasta que el iterable se agote, momento en el que se lanza una " +"excepción :exc:`StopIteration`):" #: ../Doc/library/unittest.mock.rst:1196 msgid "" "If any members of the iterable are exceptions they will be raised instead of " "returned::" msgstr "" +"Si cualquier miembro del iterable es una excepción, se lanzará en lugar de " +"retornarse:" #: ../Doc/library/unittest.mock.rst:1214 msgid "Deleting Attributes" -msgstr "" +msgstr "La eliminación de atributos" #: ../Doc/library/unittest.mock.rst:1216 msgid "" "Mock objects create attributes on demand. This allows them to pretend to be " "objects of any type." msgstr "" +"Los objetos simulados crear atributos en demanda. Esto les permite pasarse por " +"objetos de cualquier tipo." #: ../Doc/library/unittest.mock.rst:1219 msgid "" "You may want a mock object to return ``False`` to a :func:`hasattr` call, or " -"raise an :exc:`AttributeError` when an attribute is fetched. You can do this " -"by providing an object as a :attr:`spec` for a mock, but that isn't always " +"raise an :exc:`AttributeError` when an attribute is fetched. You can do this by " +"providing an object as a :attr:`spec` for a mock, but that isn't always " "convenient." msgstr "" +"Es posible que desees que un objeto simulado retorne ``False`` al llamar a :" +"func:`hasattr`, o que lance una excepción :exc:`AttributeError` cuando se " +"intenta obtener un atributo. Puedes hacer todo esto proporcionando un objeto " +"adecuado al atributo :attr:`spec` del objeto simulado, pero no siempre es " +"conveniente." #: ../Doc/library/unittest.mock.rst:1223 msgid "" -"You \"block\" attributes by deleting them. Once deleted, accessing an " -"attribute will raise an :exc:`AttributeError`." +"You \"block\" attributes by deleting them. Once deleted, accessing an attribute " +"will raise an :exc:`AttributeError`." msgstr "" +"Puedes \"bloquear\" atributos eliminándolos. Una vez eliminado, el acceso a un " +"atributo lanzará una excepción :exc:`AttributeError`." #: ../Doc/library/unittest.mock.rst:1240 msgid "Mock names and the name attribute" -msgstr "" +msgstr "Los nombres de los objetos simulados y el atributo nombre" #: ../Doc/library/unittest.mock.rst:1242 msgid "" @@ -890,190 +1257,287 @@ msgid "" "creation time. There are two alternatives. One option is to use :meth:`~Mock." "configure_mock`::" msgstr "" +"Dado que \"name\" es un argumento para el constructor de la clase :class:" +"`Mock`, si quieres que tu objeto simulado tenga un atributo \"name\", no puedes " +"simplemente pasarlo al constructor en tiempo de creación. Hay dos alternativas. " +"Una opción es usar el método :meth:`~Mock.configure_mock`:" #: ../Doc/library/unittest.mock.rst:1252 msgid "" -"A simpler option is to simply set the \"name\" attribute after mock " -"creation::" +"A simpler option is to simply set the \"name\" attribute after mock creation::" msgstr "" +"Una opción más sencilla es simplemente establecer el atributo \"name\" después " +"de la creación del objeto simulado:" #: ../Doc/library/unittest.mock.rst:1259 msgid "Attaching Mocks as Attributes" -msgstr "" +msgstr "Adjuntar objetos simulados como atributos" #: ../Doc/library/unittest.mock.rst:1261 msgid "" -"When you attach a mock as an attribute of another mock (or as the return " -"value) it becomes a \"child\" of that mock. Calls to the child are recorded " -"in the :attr:`~Mock.method_calls` and :attr:`~Mock.mock_calls` attributes of " -"the parent. This is useful for configuring child mocks and then attaching " -"them to the parent, or for attaching mocks to a parent that records all " -"calls to the children and allows you to make assertions about the order of " -"calls between mocks:" -msgstr "" +"When you attach a mock as an attribute of another mock (or as the return value) " +"it becomes a \"child\" of that mock. Calls to the child are recorded in the :" +"attr:`~Mock.method_calls` and :attr:`~Mock.mock_calls` attributes of the " +"parent. This is useful for configuring child mocks and then attaching them to " +"the parent, or for attaching mocks to a parent that records all calls to the " +"children and allows you to make assertions about the order of calls between " +"mocks:" +msgstr "" +"Cuando se adjunta un objeto simulado como un atributo de otro objeto simulado " +"(o como su valor de retorno) se convierte en un \"hijo\" del mismo. Las " +"llamadas a los hijos se registran en los atributos :attr:`~Mock.method_calls` " +"y :attr:`~Mock.mock_calls` del padre. Esto es útil para configurar objetos " +"simulados hijos para después adjuntarlos al padre, o para adjuntar objetos " +"simulados a un padre que se encargará de registrar todas las llamadas a los " +"hijos, permitiéndote hacer aserciones sobre el orden de las llamadas entre " +"objetos simulados:" #: ../Doc/library/unittest.mock.rst:1279 msgid "" -"The exception to this is if the mock has a name. This allows you to prevent " -"the \"parenting\" if for some reason you don't want it to happen." +"The exception to this is if the mock has a name. This allows you to prevent the " +"\"parenting\" if for some reason you don't want it to happen." msgstr "" +"La excepción es si el objeto simulado tiene un nombre. Esto te permite evitar " +"el comportamiento de \"parentesco\" explicado si por alguna razón no deseas que " +"suceda." #: ../Doc/library/unittest.mock.rst:1290 msgid "" -"Mocks created for you by :func:`patch` are automatically given names. To " -"attach mocks that have names to a parent you use the :meth:`~Mock." -"attach_mock` method::" +"Mocks created for you by :func:`patch` are automatically given names. To attach " +"mocks that have names to a parent you use the :meth:`~Mock.attach_mock` method::" msgstr "" +"Los objetos simulados creados automáticamente por la función :func:`patch` " +"también reciben nombres automáticamente. Para adjuntar un objeto simulado con " +"nombre a un padre debes utilizar el método :meth:`~Mock.attach_mock`:" #: ../Doc/library/unittest.mock.rst:1308 msgid "" -"The only exceptions are magic methods and attributes (those that have " -"leading and trailing double underscores). Mock doesn't create these but " -"instead raises an :exc:`AttributeError`. This is because the interpreter " -"will often implicitly request these methods, and gets *very* confused to get " -"a new Mock object when it expects a magic method. If you need magic method " -"support see :ref:`magic methods `." -msgstr "" +"The only exceptions are magic methods and attributes (those that have leading " +"and trailing double underscores). Mock doesn't create these but instead raises " +"an :exc:`AttributeError`. This is because the interpreter will often implicitly " +"request these methods, and gets *very* confused to get a new Mock object when " +"it expects a magic method. If you need magic method support see :ref:`magic " +"methods `." +msgstr "" +"Las únicas excepciones son los métodos y atributos mágicos (aquellos que tienen " +"doble subrayado al principio y al final). Mock no los crea automáticamente, " +"sino que lanza una excepción :exc:`AttributeError`. Esto se debe a que el " +"intérprete a menudo solicitará implícitamente estos métodos y terminaría *muy* " +"confundido si obtiene un nuevo objeto Mock cuando espera un método mágico. Si " +"necesitas soporte para métodos mágicos, consulta :ref:`métodos mágicos `." #: ../Doc/library/unittest.mock.rst:1317 msgid "The patchers" -msgstr "" +msgstr "Parcheadores" #: ../Doc/library/unittest.mock.rst:1319 msgid "" -"The patch decorators are used for patching objects only within the scope of " -"the function they decorate. They automatically handle the unpatching for " -"you, even if exceptions are raised. All of these functions can also be used " -"in with statements or as class decorators." +"The patch decorators are used for patching objects only within the scope of the " +"function they decorate. They automatically handle the unpatching for you, even " +"if exceptions are raised. All of these functions can also be used in with " +"statements or as class decorators." msgstr "" +"Los decoradores path se utilizan para parchear los objetos sólo dentro del " +"ámbito de la función que decoran. Se encargan automáticamente de desparchear, " +"incluso si se lanzan excepciones. Todas estas funciones también se pueden " +"utilizar con declaraciones o como decoradores de clase." #: ../Doc/library/unittest.mock.rst:1326 msgid "patch" -msgstr "" +msgstr "patch" #: ../Doc/library/unittest.mock.rst:1330 msgid "" -":func:`patch` is straightforward to use. The key is to do the patching in " -"the right namespace. See the section `where to patch`_." +":func:`patch` is straightforward to use. The key is to do the patching in the " +"right namespace. See the section `where to patch`_." msgstr "" +"La función :func:`patch` es sencilla de usar. La clave es realizar la " +"aplicación de parches en el espacio de nombres correcto. Consulta la sección " +"`where to patch`_ para más detalles." #: ../Doc/library/unittest.mock.rst:1335 msgid "" ":func:`patch` acts as a function decorator, class decorator or a context " "manager. Inside the body of the function or with statement, the *target* is " -"patched with a *new* object. When the function/with statement exits the " -"patch is undone." +"patched with a *new* object. When the function/with statement exits the patch " +"is undone." msgstr "" +":func:`patch` actúa como decorador de función, decorador de clase o como " +"administrador de contexto. Ya sea en el interior del cuerpo de una función o " +"dentro de una declaración with, *target* es parcheado con un objeto *new*. " +"Cuando la función / declaración with termina su ejecución el parche se deshace " +"automáticamente." #: ../Doc/library/unittest.mock.rst:1340 msgid "" -"If *new* is omitted, then the target is replaced with an :class:`AsyncMock` " -"if the patched object is an async function or a :class:`MagicMock` " -"otherwise. If :func:`patch` is used as a decorator and *new* is omitted, the " -"created mock is passed in as an extra argument to the decorated function. " -"If :func:`patch` is used as a context manager the created mock is returned " -"by the context manager." +"If *new* is omitted, then the target is replaced with an :class:`AsyncMock` if " +"the patched object is an async function or a :class:`MagicMock` otherwise. If :" +"func:`patch` is used as a decorator and *new* is omitted, the created mock is " +"passed in as an extra argument to the decorated function. If :func:`patch` is " +"used as a context manager the created mock is returned by the context manager." msgstr "" +"Si se omite *new*, entonces el objetivo se reemplaza con un objeto :class:" +"`AsyncMock` si el objeto parcheado es una función asíncrona, o con un objeto :" +"class:`MagicMock` en caso contrario. Si se utiliza :func:`patch` como decorador " +"y se omite *new*, el objeto simulado creado se pasa como un argumento adicional " +"a la función decorada. Si se utiliza :func:`patch` como un administrador de " +"contexto, el objeto simulado creado es retornado por el administrador de " +"contexto." #: ../Doc/library/unittest.mock.rst:1348 msgid "" "*target* should be a string in the form ``'package.module.ClassName'``. The " -"*target* is imported and the specified object replaced with the *new* " -"object, so the *target* must be importable from the environment you are " -"calling :func:`patch` from. The target is imported when the decorated " -"function is executed, not at decoration time." +"*target* is imported and the specified object replaced with the *new* object, " +"so the *target* must be importable from the environment you are calling :func:" +"`patch` from. The target is imported when the decorated function is executed, " +"not at decoration time." msgstr "" +"*target* debe ser una cadena de la forma ``'paquete.modulo.NombreDeLaClase'``. " +"*target* es importado y el objeto especificado reemplazado con el objeto *new*, " +"por lo que *target* debe ser importable desde el entorno desde el cual estás " +"llamando a :func:`patch`. Hay que tener presente que *target* es importado " +"cuando se ejecuta la función decorada, no en tiempo de decoración." #: ../Doc/library/unittest.mock.rst:1354 msgid "" "The *spec* and *spec_set* keyword arguments are passed to the :class:" "`MagicMock` if patch is creating one for you." msgstr "" +"Los argumentos *spec* y *spec_set* se pasan a :class:`MagicMock` si path está " +"creando automáticamente uno para ti." #: ../Doc/library/unittest.mock.rst:1357 msgid "" -"In addition you can pass ``spec=True`` or ``spec_set=True``, which causes " -"patch to pass in the object being mocked as the spec/spec_set object." +"In addition you can pass ``spec=True`` or ``spec_set=True``, which causes patch " +"to pass in the object being mocked as the spec/spec_set object." msgstr "" +"Además, puedes pasar ``spec=True`` o ``spec_set=True``, lo que causa que path " +"pase el objeto que está siendo simulado como el objeto spec/spec_set." #: ../Doc/library/unittest.mock.rst:1360 msgid "" "*new_callable* allows you to specify a different class, or callable object, " -"that will be called to create the *new* object. By default :class:" -"`AsyncMock` is used for async functions and :class:`MagicMock` for the rest." +"that will be called to create the *new* object. By default :class:`AsyncMock` " +"is used for async functions and :class:`MagicMock` for the rest." msgstr "" +"*new_callable* te permite especificar una clase diferente, o un objeto " +"invocable, que será llamada para crear el objeto *new*. Por defecto se utiliza :" +"class:`AsyncMock` para las funciones asíncronas y :class:`MagicMock` para el " +"resto." #: ../Doc/library/unittest.mock.rst:1364 msgid "" -"A more powerful form of *spec* is *autospec*. If you set ``autospec=True`` " -"then the mock will be created with a spec from the object being replaced. " -"All attributes of the mock will also have the spec of the corresponding " -"attribute of the object being replaced. Methods and functions being mocked " -"will have their arguments checked and will raise a :exc:`TypeError` if they " -"are called with the wrong signature. For mocks replacing a class, their " -"return value (the 'instance') will have the same spec as the class. See the :" -"func:`create_autospec` function and :ref:`auto-speccing`." -msgstr "" +"A more powerful form of *spec* is *autospec*. If you set ``autospec=True`` then " +"the mock will be created with a spec from the object being replaced. All " +"attributes of the mock will also have the spec of the corresponding attribute " +"of the object being replaced. Methods and functions being mocked will have " +"their arguments checked and will raise a :exc:`TypeError` if they are called " +"with the wrong signature. For mocks replacing a class, their return value (the " +"'instance') will have the same spec as the class. See the :func:" +"`create_autospec` function and :ref:`auto-speccing`." +msgstr "" +"Una variante más poderosa de *spec* es *autospec*. Si estableces " +"``autospec=True`` el objeto simulado se creará con una especificación del " +"objeto que está siendo reemplazado. Todos los atributos del objeto simulado " +"también tendrán la especificación del atributo correspondiente del objeto que " +"está siendo reemplazado. Los argumentos de los métodos y funciones simulados " +"son comprobados y se lanzará una excepción :exc:`TypeError` si se les llama con " +"la firma incorrecta. Para los objetos simulados que sustituyen a una clase, su " +"valor de retorno (la 'instancia') tendrá la misma especificación que la clase. " +"Consultar las funciones :func:`create_autospec` y :ref:`auto-speccing` para más " +"detalles." #: ../Doc/library/unittest.mock.rst:1374 msgid "" "Instead of ``autospec=True`` you can pass ``autospec=some_object`` to use an " "arbitrary object as the spec instead of the one being replaced." msgstr "" +"En lugar de ``autospec=True`` puedes pasar ``autospec=some_object`` para " +"utilizar un objeto arbitrario como especificación en lugar del objeto " +"reemplazado." #: ../Doc/library/unittest.mock.rst:1377 msgid "" -"By default :func:`patch` will fail to replace attributes that don't exist. " -"If you pass in ``create=True``, and the attribute doesn't exist, patch will " -"create the attribute for you when the patched function is called, and delete " -"it again after the patched function has exited. This is useful for writing " -"tests against attributes that your production code creates at runtime. It is " -"off by default because it can be dangerous. With it switched on you can " -"write passing tests against APIs that don't actually exist!" -msgstr "" +"By default :func:`patch` will fail to replace attributes that don't exist. If " +"you pass in ``create=True``, and the attribute doesn't exist, patch will create " +"the attribute for you when the patched function is called, and delete it again " +"after the patched function has exited. This is useful for writing tests against " +"attributes that your production code creates at runtime. It is off by default " +"because it can be dangerous. With it switched on you can write passing tests " +"against APIs that don't actually exist!" +msgstr "" +"Por defecto :func:`patch` fallará al intentar reemplazar atributos que no " +"existen. Si pasas ``create=True`` y no existe el atributo, patch crea el " +"atributo cuando la función se llama y lo elimina de nuevo en cuanto termina de " +"ejecutarse . Esto es útil para implementar pruebas para atributos que tu código " +"de producción crea en tiempo de ejecución. Está desactivado por defecto, ya que " +"puede ser peligroso. ¡Al activarlo se pueden implementar pruebas que validen " +"APIs que en realidad no existen!" #: ../Doc/library/unittest.mock.rst:1387 msgid "" "If you are patching builtins in a module then you don't need to pass " "``create=True``, it will be added by default." msgstr "" +"Si estás parcheando objetos incorporados (builtins) en un módulo, no es " +"necesario pasar ``create=True``, ya que en este caso se agrega de forma " +"predeterminada." #: ../Doc/library/unittest.mock.rst:1391 msgid "" "Patch can be used as a :class:`TestCase` class decorator. It works by " "decorating each test method in the class. This reduces the boilerplate code " -"when your test methods share a common patchings set. :func:`patch` finds " -"tests by looking for method names that start with ``patch.TEST_PREFIX``. By " -"default this is ``'test'``, which matches the way :mod:`unittest` finds " -"tests. You can specify an alternative prefix by setting ``patch." -"TEST_PREFIX``." -msgstr "" +"when your test methods share a common patchings set. :func:`patch` finds tests " +"by looking for method names that start with ``patch.TEST_PREFIX``. By default " +"this is ``'test'``, which matches the way :mod:`unittest` finds tests. You can " +"specify an alternative prefix by setting ``patch.TEST_PREFIX``." +msgstr "" +"Path puede ser usado como un decorador de la clase :class:`TestCase`. Funciona " +"decorando cada uno de los métodos de prueba presentes en la clase. Esto reduce " +"el código repetitivo cuando tus métodos de prueba comparten un conjunto de " +"parcheo común. :func:`patch` encuentra las pruebas mediante la búsqueda de " +"métodos cuyos nombres comienzan con ``patch.TEST_PREFIX``. Por defecto es " +"``'test'``, que coincide con la forma en que :mod:`unittest` busca las pruebas. " +"Se puede especificar un prefijo alternativo estableciendo un nuevo valor para " +"el atributo ``patch.TEST_PREFIX``." #: ../Doc/library/unittest.mock.rst:1398 msgid "" "Patch can be used as a context manager, with the with statement. Here the " -"patching applies to the indented block after the with statement. If you use " -"\"as\" then the patched object will be bound to the name after the \"as\"; " -"very useful if :func:`patch` is creating a mock object for you." +"patching applies to the indented block after the with statement. If you use \"as" +"\" then the patched object will be bound to the name after the \"as\"; very " +"useful if :func:`patch` is creating a mock object for you." msgstr "" +"Patch puede ser usado como un administrador de contexto, con la declaración " +"with. En este caso el parcheo se aplica al bloque sangrado inmediatamente " +"después de la declaración with. Si utilizas \"as\", el objeto parcheado será " +"enlazado al nombre especificado después de \"as\"; muy útil si :func:`patch` " +"está creando un objeto simulado automáticamente." #: ../Doc/library/unittest.mock.rst:1403 msgid "" -":func:`patch` takes arbitrary keyword arguments. These will be passed to " -"the :class:`Mock` (or *new_callable*) on construction." +":func:`patch` takes arbitrary keyword arguments. These will be passed to the :" +"class:`Mock` (or *new_callable*) on construction." msgstr "" +":func:`patch` toma argumentos por palabra clave arbitrarios. Estos serán " +"pasados ​​a :class:`Mock` (o a *new_callable*) durante la construcción." #: ../Doc/library/unittest.mock.rst:1406 msgid "" "``patch.dict(...)``, ``patch.multiple(...)`` and ``patch.object(...)`` are " "available for alternate use-cases." msgstr "" +"``patch.dict(...)``, ``patch.multiple(...)`` y ``patch.object(...)`` están " +"disponibles para casos alternativos de uso." #: ../Doc/library/unittest.mock.rst:1409 msgid "" -":func:`patch` as function decorator, creating the mock for you and passing " -"it into the decorated function::" +":func:`patch` as function decorator, creating the mock for you and passing it " +"into the decorated function::" msgstr "" +":func:`patch` como decorador de función, crea el objeto simulado por ti y lo " +"pasa a la función decorada:" #: ../Doc/library/unittest.mock.rst:1419 msgid "" @@ -1081,6 +1545,9 @@ msgid "" "the class is instantiated in the code under test then it will be the :attr:" "`~Mock.return_value` of the mock that will be used." msgstr "" +"Parchear una clase sustituye a la clase con una *instancia* de :class:" +"`MagicMock`. Si la clase se instancia en el código bajo prueba, el atributo :" +"attr:`~Mock.return_value` del objeto simulado será el utilizado." #: ../Doc/library/unittest.mock.rst:1423 msgid "" @@ -1088,39 +1555,57 @@ msgid "" "side_effect` to return a new mock each time. Alternatively you can set the " "*return_value* to be anything you want." msgstr "" +"Si la clase se instancia en múltiples ocasiones, puedes utilizar el atributo :" +"attr:`~Mock.side_effect` para retornar un nuevo objeto simulado cada vez. O " +"también puedes establecer *return_value* para que sea lo que tu quieras." #: ../Doc/library/unittest.mock.rst:1427 msgid "" -"To configure return values on methods of *instances* on the patched class " -"you must do this on the :attr:`return_value`. For example::" +"To configure return values on methods of *instances* on the patched class you " +"must do this on the :attr:`return_value`. For example::" msgstr "" +"Para configurar valores de retorno de métodos en *instancias* de la clase " +"parcheada debes hacer uso del atributo :attr:`return_value`. Por ejemplo:" #: ../Doc/library/unittest.mock.rst:1441 msgid "" -"If you use *spec* or *spec_set* and :func:`patch` is replacing a *class*, " -"then the return value of the created mock will have the same spec. ::" +"If you use *spec* or *spec_set* and :func:`patch` is replacing a *class*, then " +"the return value of the created mock will have the same spec. ::" msgstr "" +"Si utilizas *spec* o *spec_set* y :func:`patch` está reemplazando una *clase*, " +"el valor de retorno del objeto simulado creado tendrá las mismas " +"especificaciones:" #: ../Doc/library/unittest.mock.rst:1451 msgid "" "The *new_callable* argument is useful where you want to use an alternative " -"class to the default :class:`MagicMock` for the created mock. For example, " -"if you wanted a :class:`NonCallableMock` to be used::" +"class to the default :class:`MagicMock` for the created mock. For example, if " +"you wanted a :class:`NonCallableMock` to be used::" msgstr "" +"El argumento *new_callable* es útil cuando deseas utilizar una clase por " +"defecto alternativa a :class:`MagicMock` para el objeto simulado creado. Por " +"ejemplo, si quieres que se use una clase :class:`NonCallableMock` por defecto:" #: ../Doc/library/unittest.mock.rst:1464 msgid "" "Another use case might be to replace an object with an :class:`io.StringIO` " "instance::" msgstr "" +"Otro caso de uso podría ser la sustitución de un objeto por una instancia de :" +"class:`io.StringIO`:" #: ../Doc/library/unittest.mock.rst:1477 msgid "" "When :func:`patch` is creating a mock for you, it is common that the first " -"thing you need to do is to configure the mock. Some of that configuration " -"can be done in the call to patch. Any arbitrary keywords you pass into the " -"call will be used to set attributes on the created mock::" +"thing you need to do is to configure the mock. Some of that configuration can " +"be done in the call to patch. Any arbitrary keywords you pass into the call " +"will be used to set attributes on the created mock::" msgstr "" +"Cuando :func:`patch` crea un objeto simulado para ti, a menudo lo primero que " +"tienes que hacer es configurar el objeto simulado recién creado. Parte de la " +"configuración se puede hacer en la propia llamada a patch. Cualquier palabra " +"clave arbitraria que pases a la llamada será utilizada para establecer los " +"atributos del objeto simulado creado:" #: ../Doc/library/unittest.mock.rst:1489 msgid "" @@ -1130,129 +1615,182 @@ msgid "" "arguments, but a dictionary with these as keys can still be expanded into a :" "func:`patch` call using ``**``::" msgstr "" +"Los atributos de los objetos simulados hijos, como :attr:`~Mock.return_value` " +"y :attr:`~Mock.side_effect`, también puede ser configurados en la llamada, dado " +"que los objetos simulados hijos son atributos en si mismos del objeto simulado " +"padre creado. Eso si, estos no son sintácticamente válidos para ser pasados " +"directamente como argumentos por palabras clave a la función patch, pero un " +"diccionario con ellos como claves si que puede ser expandido en una llama a :" +"func:`patch` usando ``**``:" #: ../Doc/library/unittest.mock.rst:1505 msgid "" "By default, attempting to patch a function in a module (or a method or an " -"attribute in a class) that does not exist will fail with :exc:" -"`AttributeError`::" +"attribute in a class) that does not exist will fail with :exc:`AttributeError`::" msgstr "" +"Por defecto, el intento de parchear una función en un módulo (o un método o " +"atributo en una clase) que no existe fallará lanzando una excepción :exc:" +"`AttributeError`:" #: ../Doc/library/unittest.mock.rst:1517 msgid "" -"but adding ``create=True`` in the call to :func:`patch` will make the " -"previous example work as expected::" +"but adding ``create=True`` in the call to :func:`patch` will make the previous " +"example work as expected::" msgstr "" +"pero añadir ``create=True`` en la llamada a :func:`patch` hará que el ejemplo " +"previo funcione como se esperaba:" #: ../Doc/library/unittest.mock.rst:1528 msgid "" ":func:`patch` now returns an :class:`AsyncMock` if the target is an async " "function." msgstr "" +":func:`patch` ahora retorna una instancia de :class:`AsyncMock` si el objetivo " +"es una función asíncrona." #: ../Doc/library/unittest.mock.rst:1532 msgid "patch.object" -msgstr "" +msgstr "patch.object" #: ../Doc/library/unittest.mock.rst:1536 msgid "" -"patch the named member (*attribute*) on an object (*target*) with a mock " -"object." +"patch the named member (*attribute*) on an object (*target*) with a mock object." msgstr "" +"parchea el miembro llamado (*attribute*) en un objeto (*target*) con un objeto " +"simulado." #: ../Doc/library/unittest.mock.rst:1539 msgid "" -":func:`patch.object` can be used as a decorator, class decorator or a " -"context manager. Arguments *new*, *spec*, *create*, *spec_set*, *autospec* " -"and *new_callable* have the same meaning as for :func:`patch`. Like :func:" -"`patch`, :func:`patch.object` takes arbitrary keyword arguments for " -"configuring the mock object it creates." +":func:`patch.object` can be used as a decorator, class decorator or a context " +"manager. Arguments *new*, *spec*, *create*, *spec_set*, *autospec* and " +"*new_callable* have the same meaning as for :func:`patch`. Like :func:`patch`, :" +"func:`patch.object` takes arbitrary keyword arguments for configuring the mock " +"object it creates." msgstr "" +":func:`patch.object` se puede utilizar como un decorador, decorador de clase o " +"un administrador de contexto. Los argumentos *new*, *spec*, *create*, " +"*spec_set*, *autospec* y *new_callable* tienen el mismo significado que en la " +"función :func:`patch`. Al igual que :func:`patch`, :func:`patch.object` toma " +"argumentos por palabras clave arbitrarios para la configuración del objeto " +"simulado que crea." #: ../Doc/library/unittest.mock.rst:1545 msgid "" "When used as a class decorator :func:`patch.object` honours ``patch." "TEST_PREFIX`` for choosing which methods to wrap." msgstr "" +"Cuando se utiliza como un decorador de clase :func:`patch.object` se rige por " +"``patch.TEST_PREFIX`` a la hora de elegir los métodos a envolver." #: ../Doc/library/unittest.mock.rst:1548 msgid "" -"You can either call :func:`patch.object` with three arguments or two " -"arguments. The three argument form takes the object to be patched, the " -"attribute name and the object to replace the attribute with." +"You can either call :func:`patch.object` with three arguments or two arguments. " +"The three argument form takes the object to be patched, the attribute name and " +"the object to replace the attribute with." msgstr "" +"Puedes llamar a :func:`patch.object` con tres argumentos o con dos argumentos. " +"La forma de tres argumento toma el objeto a parchear, el nombre del atributo y " +"el objeto con el que reemplazar el atributo." #: ../Doc/library/unittest.mock.rst:1552 msgid "" -"When calling with the two argument form you omit the replacement object, and " -"a mock is created for you and passed in as an extra argument to the " -"decorated function:" +"When calling with the two argument form you omit the replacement object, and a " +"mock is created for you and passed in as an extra argument to the decorated " +"function:" msgstr "" +"Al llamar a la forma de dos argumento se omite el objeto de sustitución, por lo " +"tanto se crea un objeto simulado automáticamente y se pasa como argumento " +"adicional a la función decorada:" #: ../Doc/library/unittest.mock.rst:1563 msgid "" -"*spec*, *create* and the other arguments to :func:`patch.object` have the " -"same meaning as they do for :func:`patch`." +"*spec*, *create* and the other arguments to :func:`patch.object` have the same " +"meaning as they do for :func:`patch`." msgstr "" +"*spec*, *create* y el resto de argumentos de :func:`patch.object` tienen el " +"mismo significado que en la función :func:`patch`." #: ../Doc/library/unittest.mock.rst:1568 msgid "patch.dict" -msgstr "" +msgstr "patch.dict" #: ../Doc/library/unittest.mock.rst:1572 msgid "" "Patch a dictionary, or dictionary like object, and restore the dictionary to " "its original state after the test." msgstr "" +"Parchea un diccionario o un objeto similar a un diccionario y restaurara el " +"diccionario a su estado original una vez terminada la prueba." #: ../Doc/library/unittest.mock.rst:1575 msgid "" -"*in_dict* can be a dictionary or a mapping like container. If it is a " -"mapping then it must at least support getting, setting and deleting items " -"plus iterating over keys." +"*in_dict* can be a dictionary or a mapping like container. If it is a mapping " +"then it must at least support getting, setting and deleting items plus " +"iterating over keys." msgstr "" +"*in_dict* puede ser un diccionario o un contenedor similar a uno. Si se trata " +"de un objeto similar a un diccionario, debe soportar como mínimo el " +"establecimiento, la obtención y la eliminación de elementos, además de permitir " +"la iteración sobre las claves." #: ../Doc/library/unittest.mock.rst:1579 msgid "" "*in_dict* can also be a string specifying the name of the dictionary, which " "will then be fetched by importing it." msgstr "" +"*in_dict* también puede ser una cadena que especifique el nombre del " +"diccionario a parchear, el nombre es usado para obtener el diccionario mediante " +"importación." #: ../Doc/library/unittest.mock.rst:1582 msgid "" -"*values* can be a dictionary of values to set in the dictionary. *values* " -"can also be an iterable of ``(key, value)`` pairs." +"*values* can be a dictionary of values to set in the dictionary. *values* can " +"also be an iterable of ``(key, value)`` pairs." msgstr "" +"*values* puede ser otro diccionario con valores para ser añadidos al " +"diccionario. *values* también puede ser un iterable de parejas ``(clave, " +"valor)``." #: ../Doc/library/unittest.mock.rst:1585 msgid "" "If *clear* is true then the dictionary will be cleared before the new values " "are set." msgstr "" +"Si *clear* es verdadero, el contenido del diccionario se borrará antes de " +"establecer los nuevos valores." #: ../Doc/library/unittest.mock.rst:1588 msgid "" -":func:`patch.dict` can also be called with arbitrary keyword arguments to " -"set values in the dictionary." +":func:`patch.dict` can also be called with arbitrary keyword arguments to set " +"values in the dictionary." msgstr "" +"La función :func:`patch.dict` también puede ser llamada con argumentos por " +"palabra clave arbitrarios para establecer los valores en el diccionario." #: ../Doc/library/unittest.mock.rst:1593 msgid "" ":func:`patch.dict` now returns the patched dictionary when used as a context " "manager." msgstr "" +"La función :func:`patch.dict` ahora retorna el diccionario parcheado cuando se " +"utiliza como administrador de contexto." #: ../Doc/library/unittest.mock.rst:1596 msgid "" ":func:`patch.dict` can be used as a context manager, decorator or class " "decorator:" msgstr "" +":func:`patch.dict` se puede utilizar como administrador de contexto, decorador " +"o decorador de clase:" #: ../Doc/library/unittest.mock.rst:1606 msgid "" -"When used as a class decorator :func:`patch.dict` honours ``patch." -"TEST_PREFIX`` (default to ``'test'``) for choosing which methods to wrap:" +"When used as a class decorator :func:`patch.dict` honours ``patch.TEST_PREFIX`` " +"(default to ``'test'``) for choosing which methods to wrap:" msgstr "" +"Cuando se utiliza :func:`patch.dict` como decorador de clase, se rige por " +"``patch.TEST_PREFIX`` (por defecto ``'test'``) a la hora de elegir qué métodos " +"envolver:" #: ../Doc/library/unittest.mock.rst:1617 msgid "" @@ -1260,87 +1798,126 @@ msgid "" "patchers of the different prefix by setting ``patch.TEST_PREFIX``. For more " "details about how to change the value of see :ref:`test-prefix`." msgstr "" +"Si deseas utilizar un prefijo diferente para tu prueba, puede informar a los " +"parcheadores del nuevo prefijo a usar estableciendo ``patch.TEST_PREFIX``. Para " +"más detalles sobre cómo cambiar el valor del atributo consultar :ref:`test-" +"prefix`." #: ../Doc/library/unittest.mock.rst:1621 msgid "" -":func:`patch.dict` can be used to add members to a dictionary, or simply let " -"a test change a dictionary, and ensure the dictionary is restored when the " -"test ends." +":func:`patch.dict` can be used to add members to a dictionary, or simply let a " +"test change a dictionary, and ensure the dictionary is restored when the test " +"ends." msgstr "" +":func:`patch.dict` puede utilizarse para agregar miembros a un diccionario, o " +"simplemente dejar que una prueba modifique un diccionario, y asegurar que el " +"diccionario será restablecido cuando finalice la misma." #: ../Doc/library/unittest.mock.rst:1642 msgid "" "Keywords can be used in the :func:`patch.dict` call to set values in the " "dictionary:" msgstr "" +"Los argumentos por palabra clave pueden ser utilizados en la llamada a :func:" +"`patch.dict` para establecer valores en el diccionario:" #: ../Doc/library/unittest.mock.rst:1652 msgid "" ":func:`patch.dict` can be used with dictionary like objects that aren't " "actually dictionaries. At the very minimum they must support item getting, " -"setting, deleting and either iteration or membership test. This corresponds " -"to the magic methods :meth:`__getitem__`, :meth:`__setitem__`, :meth:" -"`__delitem__` and either :meth:`__iter__` or :meth:`__contains__`." +"setting, deleting and either iteration or membership test. This corresponds to " +"the magic methods :meth:`__getitem__`, :meth:`__setitem__`, :meth:`__delitem__` " +"and either :meth:`__iter__` or :meth:`__contains__`." msgstr "" +":func:`patch.dict` se puede utilizar con objetos similares a un diccionario, " +"que no son realmente diccionarios. Estos objetos como mínimo deben permitir " +"obtener, establecer y borrar elementos, además de soportar la iteración o la " +"prueba de pertenencia. Dichas funcionalidades se corresponden a los métodos " +"mágicos :meth:`__getitem__`, :meth:`__setitem__`, :meth:`__delitem__` y :meth:" +"`__iter__` o :meth:`__contains__`." #: ../Doc/library/unittest.mock.rst:1681 msgid "patch.multiple" -msgstr "" +msgstr "patch.multiple" #: ../Doc/library/unittest.mock.rst:1685 msgid "" "Perform multiple patches in a single call. It takes the object to be patched " -"(either as an object or a string to fetch the object by importing) and " -"keyword arguments for the patches::" +"(either as an object or a string to fetch the object by importing) and keyword " +"arguments for the patches::" msgstr "" +"Realiza múltiples parches en una sola llamada. Se toma el objeto a ser " +"parcheado (ya sea como un objeto o una cadena de caracteres con el nombre del " +"mismo para obtener el objeto mediante importación) y los argumentos por " +"palabras clave para los parches:" #: ../Doc/library/unittest.mock.rst:1692 msgid "" -"Use :data:`DEFAULT` as the value if you want :func:`patch.multiple` to " -"create mocks for you. In this case the created mocks are passed into a " -"decorated function by keyword, and a dictionary is returned when :func:" -"`patch.multiple` is used as a context manager." +"Use :data:`DEFAULT` as the value if you want :func:`patch.multiple` to create " +"mocks for you. In this case the created mocks are passed into a decorated " +"function by keyword, and a dictionary is returned when :func:`patch.multiple` " +"is used as a context manager." msgstr "" +"Usa :data:`DEFAULT` como valor si deseas que la función :func:`patch.multiple` " +"cree objetos simulados automáticamente por ti. En este caso, los objetos " +"simulados creados son pasados ​​a una función decorada mediante palabra clave y " +"se retorna un diccionario cuando :func:`patch.multiple` se utiliza como " +"administrador de contexto." #: ../Doc/library/unittest.mock.rst:1697 msgid "" -":func:`patch.multiple` can be used as a decorator, class decorator or a " -"context manager. The arguments *spec*, *spec_set*, *create*, *autospec* and " -"*new_callable* have the same meaning as for :func:`patch`. These arguments " -"will be applied to *all* patches done by :func:`patch.multiple`." +":func:`patch.multiple` can be used as a decorator, class decorator or a context " +"manager. The arguments *spec*, *spec_set*, *create*, *autospec* and " +"*new_callable* have the same meaning as for :func:`patch`. These arguments will " +"be applied to *all* patches done by :func:`patch.multiple`." msgstr "" +"La función :func:`patch.multiple` se puede utilizar como un decorador, " +"decorador de clase o como administrador de contexto. La argumentos *spec*, " +"*spec_set*, *create*, *autospec* y *new_callable* tienen el mismo significado " +"que en la función :func:`patch`. Estos argumentos se aplicarán a *todos* los " +"parches realizados por :func:`patch.multiple`." #: ../Doc/library/unittest.mock.rst:1702 msgid "" "When used as a class decorator :func:`patch.multiple` honours ``patch." "TEST_PREFIX`` for choosing which methods to wrap." msgstr "" +"Cuando se utiliza como decorador de clase, :func:`patch.multiple` se rige por " +"``patch.TEST_PREFIX`` a la hora de elegir qué métodos envolver." #: ../Doc/library/unittest.mock.rst:1705 msgid "" -"If you want :func:`patch.multiple` to create mocks for you, then you can " -"use :data:`DEFAULT` as the value. If you use :func:`patch.multiple` as a " -"decorator then the created mocks are passed into the decorated function by " -"keyword. ::" +"If you want :func:`patch.multiple` to create mocks for you, then you can use :" +"data:`DEFAULT` as the value. If you use :func:`patch.multiple` as a decorator " +"then the created mocks are passed into the decorated function by keyword. ::" msgstr "" +"Si deseas que :func:`patch.multiple` cree objetos simulados automáticamente por " +"ti, puedes utilizar :data:`DEFAULT` como valor. Si utilizas :func:`patch." +"multiple` como decorador, entonces los objetos simulados creados se pasan a la " +"función decorada por palabra clave:" #: ../Doc/library/unittest.mock.rst:1719 msgid "" -":func:`patch.multiple` can be nested with other ``patch`` decorators, but " -"put arguments passed by keyword *after* any of the standard arguments " -"created by :func:`patch`::" +":func:`patch.multiple` can be nested with other ``patch`` decorators, but put " +"arguments passed by keyword *after* any of the standard arguments created by :" +"func:`patch`::" msgstr "" +":func:`patch.multiple` se puede anidar junto a otros decoradores ``patch``, " +"pero los argumentos pasados ​​por palabra clave se deben agregar *después* de " +"cualquier argumento estándar creado por :func:`patch`:" #: ../Doc/library/unittest.mock.rst:1731 msgid "" -"If :func:`patch.multiple` is used as a context manager, the value returned " -"by the context manager is a dictionary where created mocks are keyed by " -"name::" +"If :func:`patch.multiple` is used as a context manager, the value returned by " +"the context manager is a dictionary where created mocks are keyed by name::" msgstr "" +"Si :func:`patch.multiple` se utiliza como un administrador de contexto, el " +"valor retornado por el mismo es un diccionario en el que los objetos simulados " +"creados son almacenados usando sus nombres como claves:" #: ../Doc/library/unittest.mock.rst:1745 msgid "patch methods: start and stop" -msgstr "" +msgstr "métodos de patch: start y stop" #: ../Doc/library/unittest.mock.rst:1747 msgid "" @@ -1348,26 +1925,36 @@ msgid "" "simpler to do patching in ``setUp`` methods or where you want to do multiple " "patches without nesting decorators or with statements." msgstr "" +"Todos los parcheadores tienen los métodos :meth:`start` y :meth:`stop`. Esto " +"facilita parchear en los métodos ``setUp`` o cuando deseas hacer múltiples " +"parches sin decoradores anidados o declaraciones with." #: ../Doc/library/unittest.mock.rst:1751 msgid "" -"To use them call :func:`patch`, :func:`patch.object` or :func:`patch.dict` " -"as normal and keep a reference to the returned ``patcher`` object. You can " -"then call :meth:`start` to put the patch in place and :meth:`stop` to undo " -"it." +"To use them call :func:`patch`, :func:`patch.object` or :func:`patch.dict` as " +"normal and keep a reference to the returned ``patcher`` object. You can then " +"call :meth:`start` to put the patch in place and :meth:`stop` to undo it." msgstr "" +"Para utilizarlos llama a :func:`patch`, :func:`patch.object` o :func:`patch." +"dict` como haces normalmente y mantén una referencia al objeto ``patcher`` " +"retornado. A continuación, puedes llamar al método :meth:`start` para aplicar " +"el parche y a :meth:`stop` para deshacerlo." #: ../Doc/library/unittest.mock.rst:1755 msgid "" "If you are using :func:`patch` to create a mock for you then it will be " "returned by the call to ``patcher.start``. ::" msgstr "" +"Si estás utilizando :func:`patch` para crear un objeto simulado " +"automáticamente, este será retornado por la llamada a ``patcher.start``:" #: ../Doc/library/unittest.mock.rst:1769 msgid "" "A typical use case for this might be for doing multiple patches in the " "``setUp`` method of a :class:`TestCase`::" msgstr "" +"Un uso típico para esto podría ser hacer múltiples parches en el método " +"``setUp`` de un :class:`TestCase`:" #: ../Doc/library/unittest.mock.rst:1791 msgid "" @@ -1376,65 +1963,85 @@ msgid "" "exception is raised in the ``setUp`` then ``tearDown`` is not called. :meth:" "`unittest.TestCase.addCleanup` makes this easier::" msgstr "" +"Si se utiliza esta técnica debes asegurarte de que el parcheo está \"sin aplicar" +"\" llamando a ``stop``. Esto puede ser más complicado de lo que parece, ya que " +"si se produce una excepción en el ``setUp`` no se llama a `tearDown`` a " +"continuación. :meth:`unittest.TestCase.addCleanup` hace que esto sea más fácil:" #: ../Doc/library/unittest.mock.rst:1806 msgid "" "As an added bonus you no longer need to keep a reference to the ``patcher`` " "object." msgstr "" +"Como beneficio adicional ya no es necesario mantener una referencia al objeto " +"``patcher``." #: ../Doc/library/unittest.mock.rst:1809 msgid "" -"It is also possible to stop all patches which have been started by using :" -"func:`patch.stopall`." +"It is also possible to stop all patches which have been started by using :func:" +"`patch.stopall`." msgstr "" +"También es posible detener todos los parches que han sido iniciados usando :" +"func:`patch.stopall`." #: ../Doc/library/unittest.mock.rst:1814 msgid "Stop all active patches. Only stops patches started with ``start``." msgstr "" +"Detiene todos los parches activos. Sólo se detienen parches iniciados con " +"``start``." #: ../Doc/library/unittest.mock.rst:1820 msgid "patch builtins" -msgstr "" +msgstr "parchear objetos incorporados (builtins)" #: ../Doc/library/unittest.mock.rst:1821 msgid "" "You can patch any builtins within a module. The following example patches " "builtin :func:`ord`::" msgstr "" +"Puedes parchear cualquier objeto incorporado dentro de un módulo. El siguiente " +"ejemplo parchea la función incorporada :func:`ord`:" #: ../Doc/library/unittest.mock.rst:1836 msgid "TEST_PREFIX" -msgstr "" +msgstr "TEST_PREFIX" #: ../Doc/library/unittest.mock.rst:1838 msgid "" -"All of the patchers can be used as class decorators. When used in this way " -"they wrap every test method on the class. The patchers recognise methods " -"that start with ``'test'`` as being test methods. This is the same way that " -"the :class:`unittest.TestLoader` finds test methods by default." +"All of the patchers can be used as class decorators. When used in this way they " +"wrap every test method on the class. The patchers recognise methods that start " +"with ``'test'`` as being test methods. This is the same way that the :class:" +"`unittest.TestLoader` finds test methods by default." msgstr "" +"Todos los parcheadores se puede utilizar como decoradores de clase. Cuando se " +"usan de esta forma, todos los métodos a probar en la clase son envueltos. Los " +"parcheadores reconocen los métodos que comienzan con ``'test'`` como métodos a " +"probar. Esta es la misma forma que la clase :class:`unittest.TestLoader` usa " +"para encontrar métodos de prueba por defecto." #: ../Doc/library/unittest.mock.rst:1843 msgid "" -"It is possible that you want to use a different prefix for your tests. You " -"can inform the patchers of the different prefix by setting ``patch." -"TEST_PREFIX``::" +"It is possible that you want to use a different prefix for your tests. You can " +"inform the patchers of the different prefix by setting ``patch.TEST_PREFIX``::" msgstr "" +"Cabe la posibilidad de que desees utilizar un prefijo diferente para las " +"pruebas. Puedes informar a los parcheadores del cambio de prefijo estableciendo " +"el atributo ``patch.TEST_PREFIX``:" #: ../Doc/library/unittest.mock.rst:1866 msgid "Nesting Patch Decorators" -msgstr "" +msgstr "Anidando decoradores patch" #: ../Doc/library/unittest.mock.rst:1868 msgid "" "If you want to perform multiple patches then you can simply stack up the " "decorators." msgstr "" +"Si deseas aplicar múltiples parches, solo tienes que apilar los decoradores." #: ../Doc/library/unittest.mock.rst:1871 msgid "You can stack up multiple patch decorators using this pattern:" -msgstr "" +msgstr "Puede apilar múltiples decoradores path siguiendo el siguiente patrón:" #: ../Doc/library/unittest.mock.rst:1887 msgid "" @@ -1442,78 +2049,111 @@ msgid "" "standard way that Python applies decorators. The order of the created mocks " "passed into your test function matches this order." msgstr "" +"Ten en cuenta que los decoradores se aplican desde abajo hacia arriba. Esta es " +"la manera estándar de Python para aplicar decoradores. El orden en el que los " +"objetos simulados generados se pasan a la función de prueba coincide con este " +"orden." #: ../Doc/library/unittest.mock.rst:1895 msgid "Where to patch" -msgstr "" +msgstr "Dónde parchear" #: ../Doc/library/unittest.mock.rst:1897 msgid "" -":func:`patch` works by (temporarily) changing the object that a *name* " -"points to with another one. There can be many names pointing to any " -"individual object, so for patching to work you must ensure that you patch " -"the name used by the system under test." +":func:`patch` works by (temporarily) changing the object that a *name* points " +"to with another one. There can be many names pointing to any individual object, " +"so for patching to work you must ensure that you patch the name used by the " +"system under test." msgstr "" +":func:`patch` funciona cambiando (temporalmente) el objeto al que apunta *name* " +"con otro. Puede haber muchos nombres apuntando a cualquier objeto individual, " +"por lo que para que el parcheo funcione, debes asegurarte de parchear el nombre " +"utilizado por el sistema concreto bajo prueba." #: ../Doc/library/unittest.mock.rst:1902 msgid "" -"The basic principle is that you patch where an object is *looked up*, which " -"is not necessarily the same place as where it is defined. A couple of " -"examples will help to clarify this." +"The basic principle is that you patch where an object is *looked up*, which is " +"not necessarily the same place as where it is defined. A couple of examples " +"will help to clarify this." msgstr "" +"El principio básico es parchear donde un objeto es *buscado*, que no es " +"necesariamente el mismo lugar donde está definido. Un par de ejemplos ayudarán " +"a aclarar esto." #: ../Doc/library/unittest.mock.rst:1906 msgid "" "Imagine we have a project that we want to test with the following structure::" msgstr "" +"Imaginemos que tenemos un proyecto que queremos probar con la siguiente " +"estructura:" #: ../Doc/library/unittest.mock.rst:1915 msgid "" "Now we want to test ``some_function`` but we want to mock out ``SomeClass`` " -"using :func:`patch`. The problem is that when we import module b, which we " -"will have to do then it imports ``SomeClass`` from module a. If we use :func:" -"`patch` to mock out ``a.SomeClass`` then it will have no effect on our test; " -"module b already has a reference to the *real* ``SomeClass`` and it looks " -"like our patching had no effect." -msgstr "" +"using :func:`patch`. The problem is that when we import module b, which we will " +"have to do then it imports ``SomeClass`` from module a. If we use :func:`patch` " +"to mock out ``a.SomeClass`` then it will have no effect on our test; module b " +"already has a reference to the *real* ``SomeClass`` and it looks like our " +"patching had no effect." +msgstr "" +"Ahora queremos probar ``some_function``, pero queremos simular ``SomeClass`` " +"utilizando :func:`patch`. El problema es que cuando importamos el módulo b, lo " +"cual tenemos que hacer obligatoriamente, se importa ``SomeClass`` del módulo a. " +"Si utilizamos :func:`patch` para simular ``a.SomeClass`` no tendrá ningún " +"efecto en nuestra prueba; el módulo b ya tiene una referencia a la " +"``SomeClass`` *real*, por lo que parece que nuestro parcheo no tuvo ningún " +"efecto." #: ../Doc/library/unittest.mock.rst:1922 msgid "" -"The key is to patch out ``SomeClass`` where it is used (or where it is " -"looked up). In this case ``some_function`` will actually look up " -"``SomeClass`` in module b, where we have imported it. The patching should " -"look like::" +"The key is to patch out ``SomeClass`` where it is used (or where it is looked " +"up). In this case ``some_function`` will actually look up ``SomeClass`` in " +"module b, where we have imported it. The patching should look like::" msgstr "" +"La clave es parchear ``SomeClass`` donde se utiliza (o donde es buscado). En " +"este caso ``some_function`` realmente va a buscar ``SomeClass`` en el módulo b, " +"donde lo hemos importado. La aplicación de parches debe ser similar a:" #: ../Doc/library/unittest.mock.rst:1928 msgid "" "However, consider the alternative scenario where instead of ``from a import " "SomeClass`` module b does ``import a`` and ``some_function`` uses ``a." -"SomeClass``. Both of these import forms are common. In this case the class " -"we want to patch is being looked up in the module and so we have to patch " -"``a.SomeClass`` instead::" +"SomeClass``. Both of these import forms are common. In this case the class we " +"want to patch is being looked up in the module and so we have to patch ``a." +"SomeClass`` instead::" msgstr "" +"Sin embargo, ten en cuenta el escenario alternativo donde en el módulo b en " +"lugar de ``from a import SomeClass`` se hace ``import a`` y ``some_function`` " +"usa ``a.SomeClass``. Ambas formas de importación son comunes. En este caso, la " +"clase que queremos parchear está siendo buscada en el módulo, por lo que " +"tenemos que parchear ``a.SomeClass``:" #: ../Doc/library/unittest.mock.rst:1937 msgid "Patching Descriptors and Proxy Objects" -msgstr "" +msgstr "Parcheando descriptores y objetos proxy" #: ../Doc/library/unittest.mock.rst:1939 msgid "" "Both patch_ and patch.object_ correctly patch and restore descriptors: class " -"methods, static methods and properties. You should patch these on the " -"*class* rather than an instance. They also work with *some* objects that " -"proxy attribute access, like the `django settings object `_." -msgstr "" +"methods, static methods and properties. You should patch these on the *class* " +"rather than an instance. They also work with *some* objects that proxy " +"attribute access, like the `django settings object `_." +msgstr "" +"Tanto patch_ como patch.object_ parchean descriptores correctamente y los " +"restauran posteriormente: métodos de clase, métodos estáticos y propiedades. " +"Los descriptores deben ser parcheados en la *class* en lugar de una instancia. " +"También trabajan *algunos* objetos que actuan como proxy en el acceso a " +"atributos, como `los objetos de configuración de django `_." #: ../Doc/library/unittest.mock.rst:1947 msgid "MagicMock and magic method support" -msgstr "" +msgstr "MagicMock y el soporte de métodos mágicos" #: ../Doc/library/unittest.mock.rst:1952 msgid "Mocking Magic Methods" -msgstr "" +msgstr "Simular métodos mágicos" #: ../Doc/library/unittest.mock.rst:1954 msgid "" @@ -1521,14 +2161,23 @@ msgid "" "\"magic methods\". This allows mock objects to replace containers or other " "objects that implement Python protocols." msgstr "" +":class:`Mock` soporta la simulación de los métodos de protocolo de Python, " +"también conocidos como \"métodos mágicos\". Esto permite a los objetos " +"simulados reemplazar contenedores u otros objetos que implementan protocolos de " +"Python." #: ../Doc/library/unittest.mock.rst:1958 msgid "" -"Because magic methods are looked up differently from normal methods [#]_, " -"this support has been specially implemented. This means that only specific " -"magic methods are supported. The supported list includes *almost* all of " -"them. If there are any missing that you need please let us know." +"Because magic methods are looked up differently from normal methods [#]_, this " +"support has been specially implemented. This means that only specific magic " +"methods are supported. The supported list includes *almost* all of them. If " +"there are any missing that you need please let us know." msgstr "" +"Dado que los métodos mágicos se buscan de manera diferente a los métodos " +"normales [#] _, este soporte ha sido especialmente implementado. Esto significa " +"que sólo es compatible con métodos mágicos específicos. La lista de métodos " +"soportados incluye *casi* todos los existentes . Si hay alguno que falta y que " +"consideras necesario, por favor háznoslo saber." #: ../Doc/library/unittest.mock.rst:1963 msgid "" @@ -1536,47 +2185,58 @@ msgid "" "function or a mock instance. If you are using a function then it *must* take " "``self`` as the first argument [#]_." msgstr "" +"Puedes simular métodos mágicos estableciendo el método que te interesa en una " +"función o en una instancia simulada. Si utilizas una función, *debe* aceptar " +"``self`` como primer argumento [#] _." #: ../Doc/library/unittest.mock.rst:1986 msgid "" "One use case for this is for mocking objects used as context managers in a :" "keyword:`with` statement:" msgstr "" +"Un caso de uso para esto es simular objetos usados ​​como administradores de " +"contexto en una declaración :keyword:`with`:" #: ../Doc/library/unittest.mock.rst:1998 msgid "" "Calls to magic methods do not appear in :attr:`~Mock.method_calls`, but they " "are recorded in :attr:`~Mock.mock_calls`." msgstr "" +"Las llamadas a métodos mágicos no aparecen registradas en :attr:`~Mock." +"method_calls`, aunque si se registran en :attr:`~Mock.mock_calls`." #: ../Doc/library/unittest.mock.rst:2003 msgid "" -"If you use the *spec* keyword argument to create a mock then attempting to " -"set a magic method that isn't in the spec will raise an :exc:" -"`AttributeError`." +"If you use the *spec* keyword argument to create a mock then attempting to set " +"a magic method that isn't in the spec will raise an :exc:`AttributeError`." msgstr "" +"Si se utiliza el argumento por palabra clave *spec* para crear un objeto " +"simulado, intentar después establecer un método mágico que no está en la " +"especificación lanzará una excepción :exc:`AttributeError`." #: ../Doc/library/unittest.mock.rst:2006 msgid "The full list of supported magic methods is:" -msgstr "" +msgstr "La lista completa de los métodos mágicos soportados es la siguiente:" #: ../Doc/library/unittest.mock.rst:2008 msgid "``__hash__``, ``__sizeof__``, ``__repr__`` and ``__str__``" -msgstr "" +msgstr "``__hash__``, ``__sizeof__``, ``__repr__`` y ``__str__``" #: ../Doc/library/unittest.mock.rst:2009 msgid "``__dir__``, ``__format__`` and ``__subclasses__``" -msgstr "" +msgstr "``__dir__``, ``__format__`` y ``__subclasses__``" #: ../Doc/library/unittest.mock.rst:2010 msgid "``__round__``, ``__floor__``, ``__trunc__`` and ``__ceil__``" -msgstr "" +msgstr "``__round__``, ``__floor__``, ``__trunc__`` y ``__ceil__``" #: ../Doc/library/unittest.mock.rst:2011 msgid "" "Comparisons: ``__lt__``, ``__gt__``, ``__le__``, ``__ge__``, ``__eq__`` and " "``__ne__``" msgstr "" +"Comparaciones: ``__lt__``, ``__gt__``, ``__le__``, ``__ge__``, ``__eq__`` y " +"``__ne__``" #: ../Doc/library/unittest.mock.rst:2013 msgid "" @@ -1584,84 +2244,101 @@ msgid "" "``__contains__``, ``__len__``, ``__iter__``, ``__reversed__`` and " "``__missing__``" msgstr "" +"Métodos de contenedores: ``__getitem__``, ``__setitem__``, ``__delitem__``, " +"``__contains__``, ``__len__``, ``__iter__``, ``__reversed__`` y ``__missing__``" #: ../Doc/library/unittest.mock.rst:2016 msgid "" -"Context manager: ``__enter__``, ``__exit__``, ``__aenter__`` and " -"``__aexit__``" +"Context manager: ``__enter__``, ``__exit__``, ``__aenter__`` and ``__aexit__``" msgstr "" +"Administrador de contexto: ``__enter__``, ``__exit__``, ``__aenter__`` y " +"``__aexit__``" #: ../Doc/library/unittest.mock.rst:2017 msgid "Unary numeric methods: ``__neg__``, ``__pos__`` and ``__invert__``" -msgstr "" +msgstr "Métodos numéricos unarios: ``__neg__``, ``__pos__`` y ``__invert__``" #: ../Doc/library/unittest.mock.rst:2018 msgid "" -"The numeric methods (including right hand and in-place variants): " -"``__add__``, ``__sub__``, ``__mul__``, ``__matmul__``, ``__div__``, " -"``__truediv__``, ``__floordiv__``, ``__mod__``, ``__divmod__``, " -"``__lshift__``, ``__rshift__``, ``__and__``, ``__xor__``, ``__or__``, and " -"``__pow__``" +"The numeric methods (including right hand and in-place variants): ``__add__``, " +"``__sub__``, ``__mul__``, ``__matmul__``, ``__div__``, ``__truediv__``, " +"``__floordiv__``, ``__mod__``, ``__divmod__``, ``__lshift__``, ``__rshift__``, " +"``__and__``, ``__xor__``, ``__or__``, and ``__pow__``" msgstr "" +"Los métodos numéricos (incluyendo métodos estándar y las variantes in-" +"placunie): ``__add__``, ``__sub__``, ``__mul__``, ``__matmul__``, ``__div__``, " +"``__truediv__``, ``__floordiv__``, ``__mod__``, ``__divmod__``, ``__lshift__``, " +"``__rshift__``, ``__and__``, ``__xor__``, ``__or__``, y ``__pow__``" #: ../Doc/library/unittest.mock.rst:2022 msgid "" "Numeric conversion methods: ``__complex__``, ``__int__``, ``__float__`` and " "``__index__``" msgstr "" +"Métodos de conversión numérica: ``__complex__``, ``__int__``, ``__float__`` y " +"``__index__``" #: ../Doc/library/unittest.mock.rst:2024 msgid "Descriptor methods: ``__get__``, ``__set__`` and ``__delete__``" -msgstr "" +msgstr "Métodos de descriptores: ``__get__``, ``__set__`` y ``__delete__``" #: ../Doc/library/unittest.mock.rst:2025 msgid "" "Pickling: ``__reduce__``, ``__reduce_ex__``, ``__getinitargs__``, " "``__getnewargs__``, ``__getstate__`` and ``__setstate__``" msgstr "" +"Pickling: ``__reduce__``, ``__reduce_ex__``, ``__getinitargs__``, " +"``__getnewargs__``, ``__getstate__`` y ``__setstate__``" #: ../Doc/library/unittest.mock.rst:2027 msgid "File system path representation: ``__fspath__``" -msgstr "" +msgstr "Representación de rutas del sistema de archivos: ``__fspath__``" #: ../Doc/library/unittest.mock.rst:2028 msgid "Asynchronous iteration methods: ``__aiter__`` and ``__anext__``" -msgstr "" +msgstr "Métodos de iteración asíncronos: ``__aiter__`` y ``__anext__``" #: ../Doc/library/unittest.mock.rst:2030 msgid "Added support for :func:`os.PathLike.__fspath__`." -msgstr "" +msgstr "Soporte para :func:`os.PathLike.__fspath__` añadido." #: ../Doc/library/unittest.mock.rst:2033 msgid "" "Added support for ``__aenter__``, ``__aexit__``, ``__aiter__`` and " "``__anext__``." msgstr "" +"Añadido soporte para ``__aenter__``, ``__aexit__``, ``__aiter__`` y " +"``__anext__``." #: ../Doc/library/unittest.mock.rst:2037 msgid "" -"The following methods exist but are *not* supported as they are either in " -"use by mock, can't be set dynamically, or can cause problems:" +"The following methods exist but are *not* supported as they are either in use " +"by mock, can't be set dynamically, or can cause problems:" msgstr "" +"Los siguientes métodos existen pero *no* están soportados, ya sea porque son " +"usados por el propio objeto simulado, porque no se pueden establecer " +"dinámicamente o porque pueden causar problemas:" #: ../Doc/library/unittest.mock.rst:2040 msgid "``__getattr__``, ``__setattr__``, ``__init__`` and ``__new__``" -msgstr "" +msgstr "``__getattr__``, ``__setattr__``, ``__init__`` y ``__new__``" #: ../Doc/library/unittest.mock.rst:2041 -msgid "" -"``__prepare__``, ``__instancecheck__``, ``__subclasscheck__``, ``__del__``" +msgid "``__prepare__``, ``__instancecheck__``, ``__subclasscheck__``, ``__del__``" msgstr "" +"``__prepare__``, ``__instancecheck__``, ``__subclasscheck__`` y ``__del__``" #: ../Doc/library/unittest.mock.rst:2046 msgid "Magic Mock" -msgstr "" +msgstr "Magic Mock" #: ../Doc/library/unittest.mock.rst:2048 msgid "" "There are two ``MagicMock`` variants: :class:`MagicMock` and :class:" "`NonCallableMagicMock`." msgstr "" +"Hay dos variantes de ``MagicMock``: :class:`MagicMock` y :class:" +"`NonCallableMagicMock`." #: ../Doc/library/unittest.mock.rst:2053 msgid "" @@ -1669,181 +2346,211 @@ msgid "" "most of the magic methods. You can use ``MagicMock`` without having to " "configure the magic methods yourself." msgstr "" +"``MagicMock`` es una subclase de :class:`Mock` con implementaciones por defecto " +"de la mayoría de los métodos mágicos. Puedes utilizar ``MagicMock`` para crear " +"objetos simulados sin tener que establecer los métodos mágicos por ti mismo." #: ../Doc/library/unittest.mock.rst:2057 msgid "The constructor parameters have the same meaning as for :class:`Mock`." msgstr "" +"Los parámetros del constructor tienen el mismo significado que en :class:`Mock`." #: ../Doc/library/unittest.mock.rst:2059 msgid "" "If you use the *spec* or *spec_set* arguments then *only* magic methods that " "exist in the spec will be created." msgstr "" +"Si utilizas los argumentos *spec* o *spec_set* entonces *solo* los métodos " +"mágicos que existan en la especificación serán creados." #: ../Doc/library/unittest.mock.rst:2065 msgid "A non-callable version of :class:`MagicMock`." -msgstr "" +msgstr "Una versión no invocable de :class:`MagicMock`." #: ../Doc/library/unittest.mock.rst:2067 msgid "" "The constructor parameters have the same meaning as for :class:`MagicMock`, " -"with the exception of *return_value* and *side_effect* which have no meaning " -"on a non-callable mock." +"with the exception of *return_value* and *side_effect* which have no meaning on " +"a non-callable mock." msgstr "" +"Los parámetros del constructor tienen el mismo significado que en :class:" +"`MagicMock`, con la excepción de *return_value* y *side_effect* que no tienen " +"significado en un objeto simulado no invocable." #: ../Doc/library/unittest.mock.rst:2071 msgid "" "The magic methods are setup with :class:`MagicMock` objects, so you can " "configure them and use them in the usual way:" msgstr "" +"Los métodos mágicos están implementados mediante objetos :class:`MagicMock`, " +"por lo que puedes configurarlos y utilizarlos de la forma habitual:" #: ../Doc/library/unittest.mock.rst:2081 msgid "" "By default many of the protocol methods are required to return objects of a " -"specific type. These methods are preconfigured with a default return value, " -"so that they can be used without you having to do anything if you aren't " -"interested in the return value. You can still *set* the return value " -"manually if you want to change the default." -msgstr "" +"specific type. These methods are preconfigured with a default return value, so " +"that they can be used without you having to do anything if you aren't " +"interested in the return value. You can still *set* the return value manually " +"if you want to change the default." +msgstr "" +"Por defecto, muchos de los métodos de protocolo están obligados a retornar " +"objetos de un tipo específico. Estos métodos están preconfigurados con un valor " +"de retorno por defecto, de manera que puedan ser utilizados sin tener que hacer " +"nada más, si no estás interesado en el valor de retorno. En todo caso, puedes " +"*establecer* el valor de retorno de forma manual si deseas cambiar el valor " +"predeterminado." #: ../Doc/library/unittest.mock.rst:2087 msgid "Methods and their defaults:" -msgstr "" +msgstr "Métodos y sus valores por defecto:" #: ../Doc/library/unittest.mock.rst:2089 msgid "``__lt__``: ``NotImplemented``" -msgstr "" +msgstr "``__lt__``: ``NotImplemented``" #: ../Doc/library/unittest.mock.rst:2090 msgid "``__gt__``: ``NotImplemented``" -msgstr "" +msgstr "``__gt__``: ``NotImplemented``" #: ../Doc/library/unittest.mock.rst:2091 msgid "``__le__``: ``NotImplemented``" -msgstr "" +msgstr "``__le__``: ``NotImplemented``" #: ../Doc/library/unittest.mock.rst:2092 msgid "``__ge__``: ``NotImplemented``" -msgstr "" +msgstr "``__ge__``: ``NotImplemented``" #: ../Doc/library/unittest.mock.rst:2093 msgid "``__int__``: ``1``" -msgstr "" +msgstr "``__int__``: ``1``" #: ../Doc/library/unittest.mock.rst:2094 msgid "``__contains__``: ``False``" -msgstr "" +msgstr "``__contains__``: ``False``" #: ../Doc/library/unittest.mock.rst:2095 msgid "``__len__``: ``0``" -msgstr "" +msgstr "``__len__``: ``0``" #: ../Doc/library/unittest.mock.rst:2096 msgid "``__iter__``: ``iter([])``" -msgstr "" +msgstr "``__iter__``: ``iter([])``" #: ../Doc/library/unittest.mock.rst:2097 msgid "``__exit__``: ``False``" -msgstr "" +msgstr "``__exit__``: ``False``" #: ../Doc/library/unittest.mock.rst:2098 msgid "``__aexit__``: ``False``" -msgstr "" +msgstr "``__aexit__``: ``False``" #: ../Doc/library/unittest.mock.rst:2099 msgid "``__complex__``: ``1j``" -msgstr "" +msgstr "``__complex__``: ``1j``" #: ../Doc/library/unittest.mock.rst:2100 msgid "``__float__``: ``1.0``" -msgstr "" +msgstr "``__float__``: ``1.0``" #: ../Doc/library/unittest.mock.rst:2101 msgid "``__bool__``: ``True``" -msgstr "" +msgstr "``__bool__``: ``True``" #: ../Doc/library/unittest.mock.rst:2102 msgid "``__index__``: ``1``" -msgstr "" +msgstr "``__index__``: ``1``" #: ../Doc/library/unittest.mock.rst:2103 msgid "``__hash__``: default hash for the mock" -msgstr "" +msgstr "``__hash__``: hash usado por defecto para el objeto simulado" #: ../Doc/library/unittest.mock.rst:2104 msgid "``__str__``: default str for the mock" -msgstr "" +msgstr "``__str__``: str por defecto para del objeto simulado" #: ../Doc/library/unittest.mock.rst:2105 msgid "``__sizeof__``: default sizeof for the mock" -msgstr "" +msgstr "``__sizeof__``: sizeof por defecto del objeto simulado" #: ../Doc/library/unittest.mock.rst:2107 msgid "For example:" -msgstr "" +msgstr "Por ejemplo:" #: ../Doc/library/unittest.mock.rst:2119 msgid "" -"The two equality methods, :meth:`__eq__` and :meth:`__ne__`, are special. " -"They do the default equality comparison on identity, using the :attr:`~Mock." +"The two equality methods, :meth:`__eq__` and :meth:`__ne__`, are special. They " +"do the default equality comparison on identity, using the :attr:`~Mock." "side_effect` attribute, unless you change their return value to return " "something else::" msgstr "" +"Los dos métodos de igualdad, :meth:`__eq__` y :meth:`__ne__`, son especiales. " +"Realizan la comparación de igualdad predeterminada basada en la identidad, " +"utilizando el atributo :attr:`~Mock.side_effect`, a menos que cambies su valor " +"de retorno para que retorne alguna otra cosa:" #: ../Doc/library/unittest.mock.rst:2133 msgid "" -"The return value of :meth:`MagicMock.__iter__` can be any iterable object " -"and isn't required to be an iterator:" +"The return value of :meth:`MagicMock.__iter__` can be any iterable object and " +"isn't required to be an iterator:" msgstr "" +"El valor de retorno de :meth:`MagicMock.__iter__` puede ser cualquier objeto " +"iterable, no se requiere que sea un iterador:" #: ../Doc/library/unittest.mock.rst:2143 msgid "" -"If the return value *is* an iterator, then iterating over it once will " -"consume it and subsequent iterations will result in an empty list:" +"If the return value *is* an iterator, then iterating over it once will consume " +"it and subsequent iterations will result in an empty list:" msgstr "" +"Si el valor de retorno *es* un iterador, al iterar sobre él una vez que se " +"consuma y todas las iteraciones subsiguientes resultarán en una lista vacía:" #: ../Doc/library/unittest.mock.rst:2152 msgid "" -"``MagicMock`` has all of the supported magic methods configured except for " -"some of the obscure and obsolete ones. You can still set these up if you " -"want." +"``MagicMock`` has all of the supported magic methods configured except for some " +"of the obscure and obsolete ones. You can still set these up if you want." msgstr "" +"``MagicMock`` tiene todos los métodos mágicos soportados configurados a " +"excepción de algunos de los más oscuros y obsoletos. De todas formas, puedes " +"configurar estos también si lo deseas." #: ../Doc/library/unittest.mock.rst:2155 msgid "" -"Magic methods that are supported but not setup by default in ``MagicMock`` " -"are:" +"Magic methods that are supported but not setup by default in ``MagicMock`` are:" msgstr "" +"Los métodos mágicos que son compatibles pero que no están configurados por " +"defecto en ``MagicMock`` son:" #: ../Doc/library/unittest.mock.rst:2157 msgid "``__subclasses__``" -msgstr "" +msgstr "``__subclasses__``" #: ../Doc/library/unittest.mock.rst:2158 msgid "``__dir__``" -msgstr "" +msgstr "``__dir__``" #: ../Doc/library/unittest.mock.rst:2159 msgid "``__format__``" -msgstr "" +msgstr "``__format__``" #: ../Doc/library/unittest.mock.rst:2160 msgid "``__get__``, ``__set__`` and ``__delete__``" -msgstr "" +msgstr "``__get__``, ``__set__`` y ``__delete__``" #: ../Doc/library/unittest.mock.rst:2161 msgid "``__reversed__`` and ``__missing__``" -msgstr "" +msgstr "``__reversed__`` y ``__missing__``" #: ../Doc/library/unittest.mock.rst:2162 msgid "" "``__reduce__``, ``__reduce_ex__``, ``__getinitargs__``, ``__getnewargs__``, " "``__getstate__`` and ``__setstate__``" msgstr "" +"``__reduce__``, ``__reduce_ex__``, ``__getinitargs__``, ``__getnewargs__``, " +"``__getstate__`` y ``__setstate__``" #: ../Doc/library/unittest.mock.rst:2164 msgid "``__getformat__`` and ``__setformat__``" -msgstr "" +msgstr "``__getformat__`` y ``__setformat__``" #: ../Doc/library/unittest.mock.rst:2168 msgid "" @@ -1851,183 +2558,259 @@ msgid "" "Different versions of Python are inconsistent about applying this rule. The " "supported protocol methods should work with all supported versions of Python." msgstr "" +"Los métodos mágicos *deben* ser buscados en la clase en lugar de en la " +"instancia. Diferentes versiones de Python son inconsistentes sobre la " +"aplicación de esta regla. Los métodos de protocolo soportados deben trabajar " +"con todas las versiones de Python." #: ../Doc/library/unittest.mock.rst:2172 msgid "" -"The function is basically hooked up to the class, but each ``Mock`` instance " -"is kept isolated from the others." +"The function is basically hooked up to the class, but each ``Mock`` instance is " +"kept isolated from the others." msgstr "" +"La función está básicamente conectada a la clase, pero cada instancia ``Mock`` " +"se mantiene aislada de las demás." #: ../Doc/library/unittest.mock.rst:2177 msgid "Helpers" -msgstr "" +msgstr "Ayudantes" #: ../Doc/library/unittest.mock.rst:2180 msgid "sentinel" -msgstr "" +msgstr "sentinel" #: ../Doc/library/unittest.mock.rst:2184 msgid "" -"The ``sentinel`` object provides a convenient way of providing unique " -"objects for your tests." +"The ``sentinel`` object provides a convenient way of providing unique objects " +"for your tests." msgstr "" +"El objeto ``sentinel`` proporciona una manera conveniente de proporcionar " +"objetos únicos para tus pruebas." #: ../Doc/library/unittest.mock.rst:2187 msgid "" "Attributes are created on demand when you access them by name. Accessing the " -"same attribute will always return the same object. The objects returned have " -"a sensible repr so that test failure messages are readable." +"same attribute will always return the same object. The objects returned have a " +"sensible repr so that test failure messages are readable." msgstr "" +"Los atributos se crean a demanda, en el instante en el que se accede a ellos " +"por su nombre por primera vez. El acceso al mismo atributo siempre retornará el " +"mismo objeto. Los objetos retornados tienen una reproducción (repr) apropiada " +"para que los mensajes de error de la prueba sean legibles." #: ../Doc/library/unittest.mock.rst:2191 msgid "" "The ``sentinel`` attributes now preserve their identity when they are :mod:" "`copied ` or :mod:`pickled `." msgstr "" +"Los atributos ``sentinel`` ahora preservan su identidad cuando son :mod:" +"`copiados ` o :mod:`serializados con pickle `." #: ../Doc/library/unittest.mock.rst:2195 msgid "" -"Sometimes when testing you need to test that a specific object is passed as " -"an argument to another method, or returned. It can be common to create named " +"Sometimes when testing you need to test that a specific object is passed as an " +"argument to another method, or returned. It can be common to create named " "sentinel objects to test this. :data:`sentinel` provides a convenient way of " "creating and testing the identity of objects like this." msgstr "" +"A veces, cuando implementas pruebas, necesitas probar que un determinado objeto " +"se pasa como argumento a otro método, o se retorna. Puede ser común crear " +"objetos centinela con un nombre para probar esto. :data:`sentinel` proporciona " +"una manera conveniente de crear y probar la identidad de los objetos de este " +"tipo." #: ../Doc/library/unittest.mock.rst:2200 msgid "" -"In this example we monkey patch ``method`` to return ``sentinel." -"some_object``:" +"In this example we monkey patch ``method`` to return ``sentinel.some_object``:" msgstr "" +"En este ejemplo, parcheamos ``method`` para retornar ``sentinel.some_object``:" #: ../Doc/library/unittest.mock.rst:2212 msgid "DEFAULT" -msgstr "" +msgstr "DEFAULT" #: ../Doc/library/unittest.mock.rst:2217 msgid "" "The :data:`DEFAULT` object is a pre-created sentinel (actually ``sentinel." -"DEFAULT``). It can be used by :attr:`~Mock.side_effect` functions to " -"indicate that the normal return value should be used." +"DEFAULT``). It can be used by :attr:`~Mock.side_effect` functions to indicate " +"that the normal return value should be used." msgstr "" +"El objeto :data:`DEFAULT` es un centinela pre-creado (actualmente ``sentinel." +"DEFAULT``). Puede ser usado por las funciones :attr:`~Mock.side_effect` para " +"indicar que el valor de retorno normal debe ser utilizado." #: ../Doc/library/unittest.mock.rst:2223 msgid "call" -msgstr "" +msgstr "call" #: ../Doc/library/unittest.mock.rst:2227 msgid "" ":func:`call` is a helper object for making simpler assertions, for comparing " "with :attr:`~Mock.call_args`, :attr:`~Mock.call_args_list`, :attr:`~Mock." -"mock_calls` and :attr:`~Mock.method_calls`. :func:`call` can also be used " -"with :meth:`~Mock.assert_has_calls`." +"mock_calls` and :attr:`~Mock.method_calls`. :func:`call` can also be used with :" +"meth:`~Mock.assert_has_calls`." msgstr "" +":func:`call` es un objeto ayudante para hacer aserciones simples, para comparar " +"con :attr:`~Mock.call_args`, :attr:`~Mock.call_args_list`, :attr:`~Mock." +"mock_calls` y :attr:`~Mock.method_calls`. :func:`call`, también se puede " +"utilizar con :meth:`~Mock.assert_has_calls`." #: ../Doc/library/unittest.mock.rst:2240 msgid "" -"For a call object that represents multiple calls, :meth:`call_list` returns " -"a list of all the intermediate calls as well as the final call." +"For a call object that represents multiple calls, :meth:`call_list` returns a " +"list of all the intermediate calls as well as the final call." msgstr "" +"Para un objeto call que representa múltiples llamadas, el método :meth:" +"`call_list` retorna una lista con todas las llamadas intermedias, así como la " +"llamada final." #: ../Doc/library/unittest.mock.rst:2244 msgid "" "``call_list`` is particularly useful for making assertions on \"chained calls" -"\". A chained call is multiple calls on a single line of code. This results " -"in multiple entries in :attr:`~Mock.mock_calls` on a mock. Manually " -"constructing the sequence of calls can be tedious." +"\". A chained call is multiple calls on a single line of code. This results in " +"multiple entries in :attr:`~Mock.mock_calls` on a mock. Manually constructing " +"the sequence of calls can be tedious." msgstr "" +"``call_list`` es particularmente útil para hacer aserciones sobre \"llamadas " +"encadenadas\". Una llamada encadenada es varias llamadas en una sola línea de " +"código. Esto resulta en múltiples entradas en el atributo :attr:`~Mock." +"mock_calls` de un objeto simulado. Construir manualmente la secuencia de " +"llamadas puede ser tedioso." #: ../Doc/library/unittest.mock.rst:2249 msgid "" ":meth:`~call.call_list` can construct the sequence of calls from the same " "chained call:" msgstr "" +":meth:`~call.call_list` puede construir la secuencia de llamadas desde la misma " +"llamada encadenada:" #: ../Doc/library/unittest.mock.rst:2266 msgid "" "A ``call`` object is either a tuple of (positional args, keyword args) or " -"(name, positional args, keyword args) depending on how it was constructed. " -"When you construct them yourself this isn't particularly interesting, but " -"the ``call`` objects that are in the :attr:`Mock.call_args`, :attr:`Mock." -"call_args_list` and :attr:`Mock.mock_calls` attributes can be introspected " -"to get at the individual arguments they contain." -msgstr "" +"(name, positional args, keyword args) depending on how it was constructed. When " +"you construct them yourself this isn't particularly interesting, but the " +"``call`` objects that are in the :attr:`Mock.call_args`, :attr:`Mock." +"call_args_list` and :attr:`Mock.mock_calls` attributes can be introspected to " +"get at the individual arguments they contain." +msgstr "" +"Un objeto ``call``, dependiendo de cómo fuera construido, puede ser una tupla " +"de la forma (argumentos posicionales, argumentos por palabras clave) o bien de " +"la forma (nombre, argumentos posicionales, argumentos por palabras clave). Esto " +"no es particularmente interesante cuando los construyes por ti mismo, pero la " +"introspección de los objetos ``call`` que se encuentran en los atributos :attr:" +"`Mock.call_args`, :attr:`Mock.call_args_list` y :attr:`Mock.mock_calls` si " +"pueden ser de utilidad para para acceder a los argumentos individuales que " +"contienen." #: ../Doc/library/unittest.mock.rst:2273 msgid "" -"The ``call`` objects in :attr:`Mock.call_args` and :attr:`Mock." -"call_args_list` are two-tuples of (positional args, keyword args) whereas " -"the ``call`` objects in :attr:`Mock.mock_calls`, along with ones you " -"construct yourself, are three-tuples of (name, positional args, keyword " -"args)." +"The ``call`` objects in :attr:`Mock.call_args` and :attr:`Mock.call_args_list` " +"are two-tuples of (positional args, keyword args) whereas the ``call`` objects " +"in :attr:`Mock.mock_calls`, along with ones you construct yourself, are three-" +"tuples of (name, positional args, keyword args)." msgstr "" +"Los objetos ``call`` en :attr:`Mock.call_args` y :attr:`Mock.call_args_list` " +"están conformados por dos tuplas (argumentos posicionales, argumentos por " +"palabra clave) mientras que los objetos ``call`` en :attr:`Mock.mock_calls`, " +"junto con los que construyas por ti mismo, constan de tres tuplas (nombre, " +"argumentos posicionales, argumentos por palabra clave)." #: ../Doc/library/unittest.mock.rst:2278 msgid "" -"You can use their \"tupleness\" to pull out the individual arguments for " -"more complex introspection and assertions. The positional arguments are a " -"tuple (an empty tuple if there are no positional arguments) and the keyword " -"arguments are a dictionary:" +"You can use their \"tupleness\" to pull out the individual arguments for more " +"complex introspection and assertions. The positional arguments are a tuple (an " +"empty tuple if there are no positional arguments) and the keyword arguments are " +"a dictionary:" msgstr "" +"Puedes utilizar tu esta presentación mediante tuplas para obtener los " +"argumentos individuales con la finalidad de llevar a cabo una introspección más " +"compleja y para realizar aserciones. Los argumentos posicionales son una tupla " +"(vacía si no hay argumentos posicionales) y los argumentos por palabra clave " +"son un diccionario:" #: ../Doc/library/unittest.mock.rst:2311 msgid "create_autospec" -msgstr "" +msgstr "create_autospec" #: ../Doc/library/unittest.mock.rst:2315 msgid "" "Create a mock object using another object as a spec. Attributes on the mock " "will use the corresponding attribute on the *spec* object as their spec." msgstr "" +"Crea un nuevo objeto simulado utilizando otro objeto (*spec*) como una " +"especificación. Los atributos del objeto simulado utilizarán el atributo " +"correspondiente del objeto *spec* como su especificación." #: ../Doc/library/unittest.mock.rst:2319 msgid "" -"Functions or methods being mocked will have their arguments checked to " -"ensure that they are called with the correct signature." +"Functions or methods being mocked will have their arguments checked to ensure " +"that they are called with the correct signature." msgstr "" +"Los argumentos de las funciones o métodos simulados se validarán para " +"asegurarse de que son llamados con la firma correcta." #: ../Doc/library/unittest.mock.rst:2322 msgid "" -"If *spec_set* is ``True`` then attempting to set attributes that don't exist " -"on the spec object will raise an :exc:`AttributeError`." +"If *spec_set* is ``True`` then attempting to set attributes that don't exist on " +"the spec object will raise an :exc:`AttributeError`." msgstr "" +"Si es *spec_set* es ``True``, tratar de establecer atributos que no existen en " +"el objeto especificado lanzará una excepción :exc:`AttributeError`." #: ../Doc/library/unittest.mock.rst:2325 msgid "" -"If a class is used as a spec then the return value of the mock (the instance " -"of the class) will have the same spec. You can use a class as the spec for " -"an instance object by passing ``instance=True``. The returned mock will only " -"be callable if instances of the mock are callable." +"If a class is used as a spec then the return value of the mock (the instance of " +"the class) will have the same spec. You can use a class as the spec for an " +"instance object by passing ``instance=True``. The returned mock will only be " +"callable if instances of the mock are callable." msgstr "" +"Si se utilizada una clase como especificación, el valor de retorno del objeto " +"simulado (la instancia de la clase) tendrá la misma especificación. Se puede " +"utilizar una clase como especificación de una instancia pasando " +"``instance=True``. El objeto simulado retornado sólo será invocable si las " +"instancias del objeto simulado son también invocables." #: ../Doc/library/unittest.mock.rst:2330 msgid "" -":func:`create_autospec` also takes arbitrary keyword arguments that are " -"passed to the constructor of the created mock." +":func:`create_autospec` also takes arbitrary keyword arguments that are passed " +"to the constructor of the created mock." msgstr "" +":func:`create_autospec` también acepta argumentos por palabra clave arbitrarios " +"que son pasados al constructor del objeto simulado creado." #: ../Doc/library/unittest.mock.rst:2333 msgid "" "See :ref:`auto-speccing` for examples of how to use auto-speccing with :func:" "`create_autospec` and the *autospec* argument to :func:`patch`." msgstr "" +"Consultar :ref:`auto-speccing` para ver ejemplos de cómo utilizar la " +"autoespecificación mediante :func:`create_autospec` y el argumento *autospec* " +"de :func:`patch`." #: ../Doc/library/unittest.mock.rst:2339 msgid "" -":func:`create_autospec` now returns an :class:`AsyncMock` if the target is " -"an async function." +":func:`create_autospec` now returns an :class:`AsyncMock` if the target is an " +"async function." msgstr "" +":func:`create_autospec` ahora retorna un objeto :class:`AsyncMock` si el " +"objetivo a simular es una función asíncrona." #: ../Doc/library/unittest.mock.rst:2344 msgid "ANY" -msgstr "" +msgstr "ANY" #: ../Doc/library/unittest.mock.rst:2348 msgid "" "Sometimes you may need to make assertions about *some* of the arguments in a " -"call to mock, but either not care about some of the arguments or want to " -"pull them individually out of :attr:`~Mock.call_args` and make more complex " +"call to mock, but either not care about some of the arguments or want to pull " +"them individually out of :attr:`~Mock.call_args` and make more complex " "assertions on them." msgstr "" +"A veces puede que necesites hacer aserciones sobre *algunos* de los argumentos " +"de una llamada al objeto simulado, pero sin preocuparte por el resto, o puede " +"que quieras hacer uso de ellos de forma individual fuera de :attr:`~Mock." +"call_args` y hacer aserciones más complejas con ellos." #: ../Doc/library/unittest.mock.rst:2353 msgid "" @@ -2035,16 +2818,22 @@ msgid "" "*everything*. Calls to :meth:`~Mock.assert_called_with` and :meth:`~Mock." "assert_called_once_with` will then succeed no matter what was passed in." msgstr "" +"Para ignorar ciertos argumentos puedes pasar objetos que se comparan como " +"iguales con *cualquier cosa*. En ese caso, las llamadas a :meth:`~Mock." +"assert_called_with` y :meth:`~Mock.assert_called_once_with` tendrán éxito sin " +"importar lo que se haya pasado realmente." #: ../Doc/library/unittest.mock.rst:2362 msgid "" -":data:`ANY` can also be used in comparisons with call lists like :attr:" -"`~Mock.mock_calls`:" +":data:`ANY` can also be used in comparisons with call lists like :attr:`~Mock." +"mock_calls`:" msgstr "" +":data:`ANY` también se puede utilizar en las comparaciones con las listas de " +"llamadas como :attr:`~Mock.mock_calls`:" #: ../Doc/library/unittest.mock.rst:2375 msgid "FILTER_DIR" -msgstr "" +msgstr "FILTER_DIR" #: ../Doc/library/unittest.mock.rst:2379 msgid "" @@ -2054,15 +2843,26 @@ msgid "" "useful members. If you dislike this filtering, or need to switch it off for " "diagnostic purposes, then set ``mock.FILTER_DIR = False``." msgstr "" +":data:`FILTER_DIR` es una variable definida a nivel de módulo que controla la " +"forma en la que los objetos simulados responden a :func:`dir` (sólo para Python " +"2.6 y en adelante). El valor predeterminado es ``True``, que utiliza el " +"filtrado descrito a continuación, con la finalidad de mostrar solo los miembros " +"considerados como útiles. Si no te gusta este filtrado, o necesitas " +"desactivarlo con fines de diagnóstico, simplemente establece ``mock.FILTER_DIR " +"= False``." #: ../Doc/library/unittest.mock.rst:2385 msgid "" "With filtering on, ``dir(some_mock)`` shows only useful attributes and will " -"include any dynamically created attributes that wouldn't normally be shown. " -"If the mock was created with a *spec* (or *autospec* of course) then all the " -"attributes from the original are shown, even if they haven't been accessed " -"yet:" +"include any dynamically created attributes that wouldn't normally be shown. If " +"the mock was created with a *spec* (or *autospec* of course) then all the " +"attributes from the original are shown, even if they haven't been accessed yet:" msgstr "" +"Con el filtrado activado, ``dir(some_mock)`` mostrará solo atributos útiles y " +"además incluirá cualquier atributo creado dinámicamente, que normalmente no se " +"mostraría. Si el objeto simulado fue creado con un *spec* (o *autospec*) se " +"muestran todos los atributos del objeto original, incluso si no se ha accedido " +"a ellos todavía:" #: ../Doc/library/unittest.mock.rst:2412 msgid "" @@ -2072,30 +2872,44 @@ msgid "" "dislike this behaviour you can switch it off by setting the module level " "switch :data:`FILTER_DIR`:" msgstr "" +"Muchos de los atributos con subrayado y doble subrayado no muy útiles " +"(atributos privados de :class:`Mock` y no del objeto real que se está " +"simulando) se han filtrado del resultado de llamar a :func:`dir` en un :class:" +"`Mock`. Si no te gusta este comportamiento, puedes desactivarlo estableciendo " +"el modificador a nivel de módulo :data:`FILTER_DIR`:" #: ../Doc/library/unittest.mock.rst:2433 msgid "" "Alternatively you can just use ``vars(my_mock)`` (instance members) and " -"``dir(type(my_mock))`` (type members) to bypass the filtering irrespective " -"of :data:`mock.FILTER_DIR`." +"``dir(type(my_mock))`` (type members) to bypass the filtering irrespective of :" +"data:`mock.FILTER_DIR`." msgstr "" +"Como alternativa, puedes usar ``vars(my_mock)`` (miembros de instancia) y " +"``dir(type(my_mock))`` (miembros de tipo) para omitir el filtrado con " +"independencia del valor de :data:`mock.FILTER_DIR`." #: ../Doc/library/unittest.mock.rst:2439 msgid "mock_open" -msgstr "" +msgstr "mock_open" #: ../Doc/library/unittest.mock.rst:2443 msgid "" -"A helper function to create a mock to replace the use of :func:`open`. It " -"works for :func:`open` called directly or used as a context manager." +"A helper function to create a mock to replace the use of :func:`open`. It works " +"for :func:`open` called directly or used as a context manager." msgstr "" +"Una función auxiliar para un objeto simulado con la finalidad de reemplazar el " +"uso de :func:`open`. Funciona tanto para la llamada directa a :func:`open` como " +"utilizado como administrador de contexto." #: ../Doc/library/unittest.mock.rst:2446 msgid "" -"The *mock* argument is the mock object to configure. If ``None`` (the " -"default) then a :class:`MagicMock` will be created for you, with the API " -"limited to methods or attributes available on standard file handles." +"The *mock* argument is the mock object to configure. If ``None`` (the default) " +"then a :class:`MagicMock` will be created for you, with the API limited to " +"methods or attributes available on standard file handles." msgstr "" +"El argumento *mock* es el objeto simulado a configurar. Si es ``None`` (por " +"defecto) un objeto :class:`MagicMock` se creará para ti, con la API limitada a " +"métodos o atributos disponibles en los gestores de fichero estándares." #: ../Doc/library/unittest.mock.rst:2450 msgid "" @@ -2104,77 +2918,113 @@ msgid "" "return. Calls to those methods will take data from *read_data* until it is " "depleted. The mock of these methods is pretty simplistic: every time the " "*mock* is called, the *read_data* is rewound to the start. If you need more " -"control over the data that you are feeding to the tested code you will need " -"to customize this mock for yourself. When that is insufficient, one of the " -"in-memory filesystem packages on `PyPI `_ can offer a " -"realistic filesystem for testing." -msgstr "" +"control over the data that you are feeding to the tested code you will need to " +"customize this mock for yourself. When that is insufficient, one of the in-" +"memory filesystem packages on `PyPI `_ can offer a realistic " +"filesystem for testing." +msgstr "" +"*read_data* es una cadena de caracteres para los métodos :meth:`~io.IOBase." +"read`, :meth:`~io.IOBase.readline` y :meth:`~io.IOBase.readlines` del gestor de " +"fichero a retornar. Las llamadas a los métodos tomarán datos de *read_data* " +"hasta que se agote. El objeto simulado de estos métodos es bastante simple: " +"cada vez que el *mock* se llama, *read_data* se rebobina hasta el principio. Si " +"necesitas más control sobre los datos que estás proporcionando al código de " +"prueba tendrás que personalizar el objeto simulado. Cuando eso no sea " +"suficiente, alguno de los paquetes que implementan sistemas de archivos en " +"memoria disponible en `PyPI `_ puede ofrecer un sistema de " +"archivos realista para usar en las pruebas." #: ../Doc/library/unittest.mock.rst:2460 msgid "" -"Added :meth:`~io.IOBase.readline` and :meth:`~io.IOBase.readlines` support. " -"The mock of :meth:`~io.IOBase.read` changed to consume *read_data* rather " -"than returning it on each call." +"Added :meth:`~io.IOBase.readline` and :meth:`~io.IOBase.readlines` support. The " +"mock of :meth:`~io.IOBase.read` changed to consume *read_data* rather than " +"returning it on each call." msgstr "" +"Añadido soporte para :meth:`~io.IOBase.readline` y :meth:`~io.IOBase." +"readlines`. El objeto simulado de :meth:`~io.IOBase.read` ahora consume datos " +"de *read_data* en lugar de retornarlo en cada llamada." #: ../Doc/library/unittest.mock.rst:2465 msgid "*read_data* is now reset on each call to the *mock*." -msgstr "" +msgstr "*read_data* ahora es restablecido en cada llamada al *mock*." #: ../Doc/library/unittest.mock.rst:2468 msgid "" "Added :meth:`__iter__` to implementation so that iteration (such as in for " "loops) correctly consumes *read_data*." msgstr "" +"Añadido el método :meth:`__iter__` a la implementación, de manera que la " +"iteración (como ocurre en los bucles) consume apropiadamente *read_data*." #: ../Doc/library/unittest.mock.rst:2472 msgid "" "Using :func:`open` as a context manager is a great way to ensure your file " "handles are closed properly and is becoming common::" msgstr "" +"Usar :func:`open` como un administrador de contexto es una buena manera de " +"asegurarse de que los gestores de fichero se cierran correctamente al terminar " +"y se está convirtiendo en una práctica común:" #: ../Doc/library/unittest.mock.rst:2478 msgid "" "The issue is that even if you mock out the call to :func:`open` it is the " -"*returned object* that is used as a context manager (and has :meth:" -"`__enter__` and :meth:`__exit__` called)." +"*returned object* that is used as a context manager (and has :meth:`__enter__` " +"and :meth:`__exit__` called)." msgstr "" +"El problema es que incluso si simulas la llamada a :func:`open` es el *objeto " +"retornado* el que se utiliza como administrador de contexto (lo que conlleva " +"que sus métodos :meth:`__enter__` y :meth:`__exit__` han sido llamados)." #: ../Doc/library/unittest.mock.rst:2482 msgid "" -"Mocking context managers with a :class:`MagicMock` is common enough and " -"fiddly enough that a helper function is useful. ::" +"Mocking context managers with a :class:`MagicMock` is common enough and fiddly " +"enough that a helper function is useful. ::" msgstr "" +"Simular administradores de contexto con un :class:`MagicMock` es lo " +"suficientemente común y complicado como para que una función auxiliar sea útil:" #: ../Doc/library/unittest.mock.rst:2499 msgid "And for reading files::" -msgstr "" +msgstr "Y para la lectura de archivos:" #: ../Doc/library/unittest.mock.rst:2512 msgid "Autospeccing" -msgstr "" +msgstr "Autoespecificación" #: ../Doc/library/unittest.mock.rst:2514 msgid "" -"Autospeccing is based on the existing :attr:`spec` feature of mock. It " -"limits the api of mocks to the api of an original object (the spec), but it " -"is recursive (implemented lazily) so that attributes of mocks only have the " -"same api as the attributes of the spec. In addition mocked functions / " -"methods have the same call signature as the original so they raise a :exc:" -"`TypeError` if they are called incorrectly." -msgstr "" +"Autospeccing is based on the existing :attr:`spec` feature of mock. It limits " +"the api of mocks to the api of an original object (the spec), but it is " +"recursive (implemented lazily) so that attributes of mocks only have the same " +"api as the attributes of the spec. In addition mocked functions / methods have " +"the same call signature as the original so they raise a :exc:`TypeError` if " +"they are called incorrectly." +msgstr "" +"La autoespecificación se basa en la característica :attr:`spec` ya existente en " +"el objeto simulado. Limita la API de los objetos simulados a la API del objeto " +"original (la especificación), pero es recursiva (implementada de forma " +"perezosa), de modo que los atributos del objeto simulado sólo tienen la misma " +"API que los atributos de la especificación. Además, las funciones / métodos " +"simuladas tienen la misma firma de llamada que la original y lanzan una " +"excepción :exc:`TypeError` si se les llama incorrectamente." #: ../Doc/library/unittest.mock.rst:2521 msgid "Before I explain how auto-speccing works, here's why it is needed." msgstr "" +"Antes de explicar cómo funciona la autoespecificación, he aquí por qué se " +"necesita." #: ../Doc/library/unittest.mock.rst:2523 msgid "" -":class:`Mock` is a very powerful and flexible object, but it suffers from " -"two flaws when used to mock out objects from a system under test. One of " -"these flaws is specific to the :class:`Mock` api and the other is a more " -"general problem with using mock objects." +":class:`Mock` is a very powerful and flexible object, but it suffers from two " +"flaws when used to mock out objects from a system under test. One of these " +"flaws is specific to the :class:`Mock` api and the other is a more general " +"problem with using mock objects." msgstr "" +":class:`Mock` es un objeto muy potente y flexible, pero adolece de dos defectos " +"cuando se utiliza para simular objetos de un sistema bajo prueba. Uno de estos " +"defectos es específico de la API :class:`Mock` y el otro es un problema más " +"genérico referente al uso de objetos simulados." #: ../Doc/library/unittest.mock.rst:2528 msgid "" @@ -2182,108 +3032,166 @@ msgid "" "methods that are extremely handy: :meth:`~Mock.assert_called_with` and :meth:" "`~Mock.assert_called_once_with`." msgstr "" +"En primer lugar, el problema específico a :class:`Mock`. :class:`Mock` tiene " +"dos métodos de aserción que son extremadamente útiles: :meth:`~Mock." +"assert_called_with` y :meth:`~Mock.assert_called_once_with`." #: ../Doc/library/unittest.mock.rst:2541 msgid "" -"Because mocks auto-create attributes on demand, and allow you to call them " -"with arbitrary arguments, if you misspell one of these assert methods then " -"your assertion is gone:" +"Because mocks auto-create attributes on demand, and allow you to call them with " +"arbitrary arguments, if you misspell one of these assert methods then your " +"assertion is gone:" msgstr "" +"Debido a que el objeto simulado crea automáticamente atributos según demanda y " +"permiten que se les llame con argumentos arbitrarios, si escribes mal uno de " +"estos métodos de aserción, la utilidad de esa aserción desaparece:" #: ../Doc/library/unittest.mock.rst:2551 msgid "Your tests can pass silently and incorrectly because of the typo." msgstr "" +"Tus pruebas pueden pasar silenciosamente y de forma incorrecta debido al error " +"tipográfico." #: ../Doc/library/unittest.mock.rst:2553 msgid "" -"The second issue is more general to mocking. If you refactor some of your " -"code, rename members and so on, any tests for code that is still using the " -"*old api* but uses mocks instead of the real objects will still pass. This " -"means your tests can all pass even though your code is broken." +"The second issue is more general to mocking. If you refactor some of your code, " +"rename members and so on, any tests for code that is still using the *old api* " +"but uses mocks instead of the real objects will still pass. This means your " +"tests can all pass even though your code is broken." msgstr "" +"El segundo problema es algo más general en las simulaciones. Si refactorizas " +"parte de tu código, cambias el nombre de los miembros, etc., las pruebas para " +"el código que siguen utilizando la *antigua API* pero utilizan objetos " +"simulados en lugar de los objetos reales todavía pasarán las pruebas. Esto " +"significa que tus pruebas pueden validarlo todo sin problemas a pesar de que el " +"código esté roto." #: ../Doc/library/unittest.mock.rst:2558 msgid "" -"Note that this is another reason why you need integration tests as well as " -"unit tests. Testing everything in isolation is all fine and dandy, but if " -"you don't test how your units are \"wired together\" there is still lots of " -"room for bugs that tests might have caught." +"Note that this is another reason why you need integration tests as well as unit " +"tests. Testing everything in isolation is all fine and dandy, but if you don't " +"test how your units are \"wired together\" there is still lots of room for bugs " +"that tests might have caught." msgstr "" +"Ten en cuenta que esta es otra razón por la que necesita pruebas de integración " +"además de pruebas unitarias. Probar todo de forma aislada está muy bien, pero " +"si no pruebas cómo están \"conectadas entre sí\" tus unidades, todavía hay " +"mucho espacio para errores que las pruebas deberían haber detectado." #: ../Doc/library/unittest.mock.rst:2563 msgid "" -":mod:`mock` already provides a feature to help with this, called speccing. " -"If you use a class or instance as the :attr:`spec` for a mock then you can " -"only access attributes on the mock that exist on the real class:" +":mod:`mock` already provides a feature to help with this, called speccing. If " +"you use a class or instance as the :attr:`spec` for a mock then you can only " +"access attributes on the mock that exist on the real class:" msgstr "" +":mod:`mock` ya proporciona una característica para ayudar con esto, llamada " +"especificación. Si se utiliza una clase o instancia como atributo :attr:`spec` " +"de un objeto simulado, entonces solo puedes acceder a los atributos del mismo " +"que existe en la clase real:" #: ../Doc/library/unittest.mock.rst:2574 msgid "" -"The spec only applies to the mock itself, so we still have the same issue " -"with any methods on the mock:" +"The spec only applies to the mock itself, so we still have the same issue with " +"any methods on the mock:" msgstr "" +"La especificación sólo se aplica al propio objeto simulado, por lo que aún " +"tenemos el mismo problema con cualquiera de los métodos del mismo:" #: ../Doc/library/unittest.mock.rst:2583 msgid "" "Auto-speccing solves this problem. You can either pass ``autospec=True`` to :" -"func:`patch` / :func:`patch.object` or use the :func:`create_autospec` " -"function to create a mock with a spec. If you use the ``autospec=True`` " -"argument to :func:`patch` then the object that is being replaced will be " -"used as the spec object. Because the speccing is done \"lazily\" (the spec " -"is created as attributes on the mock are accessed) you can use it with very " -"complex or deeply nested objects (like modules that import modules that " -"import modules) without a big performance hit." -msgstr "" +"func:`patch` / :func:`patch.object` or use the :func:`create_autospec` function " +"to create a mock with a spec. If you use the ``autospec=True`` argument to :" +"func:`patch` then the object that is being replaced will be used as the spec " +"object. Because the speccing is done \"lazily\" (the spec is created as " +"attributes on the mock are accessed) you can use it with very complex or deeply " +"nested objects (like modules that import modules that import modules) without a " +"big performance hit." +msgstr "" +"La autoespecificación resuelve este problema. Puedes pasar ``autospec=True`` a :" +"func:`patch` / :func:`patch.object` o utilizar la función :func:" +"`create_autospec` para crear un objeto simulado con una especificación. Si " +"utilizas el argumento ``autospec=True`` de :func:`patch` el objeto que se va a " +"reemplazar se utiliza como objeto de especificación. Debido a que la " +"especificación se hace \"perezosamente\" (la especificación se crea en el " +"instante en el que se accede a los atributos en la maqueta, no antes) se puede " +"utilizar con objetos muy complejos o anidadas (como módulos que importan " +"módulos que, a su vez, importan otros módulos) sin un gran impacto en el " +"rendimiento." #: ../Doc/library/unittest.mock.rst:2592 msgid "Here's an example of it in use::" -msgstr "" +msgstr "He aquí un ejemplo de ello en uso:" #: ../Doc/library/unittest.mock.rst:2602 msgid "" -"You can see that :class:`request.Request` has a spec. :class:`request." -"Request` takes two arguments in the constructor (one of which is *self*). " -"Here's what happens if we try to call it incorrectly::" +"You can see that :class:`request.Request` has a spec. :class:`request.Request` " +"takes two arguments in the constructor (one of which is *self*). Here's what " +"happens if we try to call it incorrectly::" msgstr "" +"Se puede ver que :class:`request.Request` tiene una especificación. :class:" +"`request.Request` toma dos argumentos en el constructor (uno de los cuales es " +"*self*). Esto es lo que sucede si tratamos de llamarlo de forma incorrecta:" #: ../Doc/library/unittest.mock.rst:2611 msgid "" -"The spec also applies to instantiated classes (i.e. the return value of " -"specced mocks)::" +"The spec also applies to instantiated classes (i.e. the return value of specced " +"mocks)::" msgstr "" +"La especificación también se aplica a las clases instanciadas (es decir, el " +"valor de retorno de los objetos simulados especificados):" #: ../Doc/library/unittest.mock.rst:2618 msgid "" -":class:`Request` objects are not callable, so the return value of " -"instantiating our mocked out :class:`request.Request` is a non-callable " -"mock. With the spec in place any typos in our asserts will raise the correct " -"error::" +":class:`Request` objects are not callable, so the return value of instantiating " +"our mocked out :class:`request.Request` is a non-callable mock. With the spec " +"in place any typos in our asserts will raise the correct error::" msgstr "" +"Los objetos de la clase :class:`Request` no son invocables, por lo que el valor " +"de retorno de una instancia de nuestro objeto simulado de :class:`request." +"Request` no es invocable. Con la especificación, en cambio, cualquier error " +"tipográfico en nuestras afirmaciones generará el error correcto:" #: ../Doc/library/unittest.mock.rst:2630 msgid "" -"In many cases you will just be able to add ``autospec=True`` to your " -"existing :func:`patch` calls and then be protected against bugs due to typos " -"and api changes." +"In many cases you will just be able to add ``autospec=True`` to your existing :" +"func:`patch` calls and then be protected against bugs due to typos and api " +"changes." msgstr "" +"En muchos casos, podrás simplemente añadir ``autospec=True`` a tus llamadas :" +"func:`patch` existentes y así estar protegido contra errores tipográficos y " +"cambios de la API." #: ../Doc/library/unittest.mock.rst:2634 msgid "" "As well as using *autospec* through :func:`patch` there is a :func:" "`create_autospec` for creating autospecced mocks directly:" msgstr "" +"Además de poder usar *autospec* a través de :func:`patch`, existe la función :" +"func:`create_autospec` para crear directamente objetos simulados " +"autoespecificados:" #: ../Doc/library/unittest.mock.rst:2642 msgid "" -"This isn't without caveats and limitations however, which is why it is not " -"the default behaviour. In order to know what attributes are available on the " -"spec object, autospec has to introspect (access attributes) the spec. As you " +"This isn't without caveats and limitations however, which is why it is not the " +"default behaviour. In order to know what attributes are available on the spec " +"object, autospec has to introspect (access attributes) the spec. As you " "traverse attributes on the mock a corresponding traversal of the original " "object is happening under the hood. If any of your specced objects have " -"properties or descriptors that can trigger code execution then you may not " -"be able to use autospec. On the other hand it is much better to design your " +"properties or descriptors that can trigger code execution then you may not be " +"able to use autospec. On the other hand it is much better to design your " "objects so that introspection is safe [#]_." msgstr "" +"Sin embargo, este no es el comportamiento predeterminado, ya que no está exento " +"de advertencias y restricciones. Con el fin de conocer que atributos están " +"disponibles en el objeto especificado, autospec tiene que hacer uso de " +"introspección sobre la especificación (acceder a los atributos). A medida que " +"recorres los atributos en el objeto simulado, se produce paralelamente y de " +"forma soterrada un recorrido del objeto original. Si alguno de tus objetos " +"especificados tienen propiedades o descriptores que puedan desencadenar la " +"ejecución de código, quizás no deberías utilizar la autoespecificación. De " +"todas formas, es siempre mucho mejor diseñar tus objetos de modo que la " +"introspección sea segura [#] _." #: ../Doc/library/unittest.mock.rst:2651 msgid "" @@ -2292,15 +3200,23 @@ msgid "" "*autospec* can't know about any dynamically created attributes and restricts " "the api to visible attributes. ::" msgstr "" +"Un problema más serio es que es común que los atributos de instancia sean " +"creados en el método :meth:`__init__` y que no existan a nivel de clase. " +"*autospec* no puede tener conocimiento de ningún atributo creado dinámicamente, " +"por lo que restringe la API a atributos visibles:" #: ../Doc/library/unittest.mock.rst:2668 msgid "" -"There are a few different ways of resolving this problem. The easiest, but " -"not necessarily the least annoying, way is to simply set the required " -"attributes on the mock after creation. Just because *autospec* doesn't allow " -"you to fetch attributes that don't exist on the spec it doesn't prevent you " -"setting them::" +"There are a few different ways of resolving this problem. The easiest, but not " +"necessarily the least annoying, way is to simply set the required attributes on " +"the mock after creation. Just because *autospec* doesn't allow you to fetch " +"attributes that don't exist on the spec it doesn't prevent you setting them::" msgstr "" +"Hay diferentes formas de resolver este problema. La forma más sencilla, pero no " +"necesariamente la menos molesta, es simplemente establecer los atributos " +"necesarios en el objeto simulado después de la creación del mismo. El hecho de " +"que *autospec* no te permita buscar atributos que no existen en la " +"especificación no impide que los establezcas manualmente después:" #: ../Doc/library/unittest.mock.rst:2679 msgid "" @@ -2309,59 +3225,94 @@ msgid "" "ensure your code only *sets* valid attributes too, but obviously it prevents " "this particular scenario:" msgstr "" +"Existe una versión más agresiva de *spec* y *autospec* que impide establecer " +"atributos inexistentes. Esto es útil si deseas asegurarte de que tu código solo " +"*establece* atributos válidos, pero obviamente evitando este escenario en " +"particular:" #: ../Doc/library/unittest.mock.rst:2692 msgid "" "Probably the best way of solving the problem is to add class attributes as " -"default values for instance members initialised in :meth:`__init__`. Note " -"that if you are only setting default attributes in :meth:`__init__` then " -"providing them via class attributes (shared between instances of course) is " -"faster too. e.g." -msgstr "" +"default values for instance members initialised in :meth:`__init__`. Note that " +"if you are only setting default attributes in :meth:`__init__` then providing " +"them via class attributes (shared between instances of course) is faster too. e." +"g." +msgstr "" +"Probablemente la mejor manera de resolver el problema es añadir atributos de " +"clase como valores por defecto para los miembros de instancia inicializados en " +"el método :meth:`__init__`. Ten en cuenta que si sólo estás estableciendo " +"atributos predeterminados en :meth:`__init__`, proporcionarlos a través de " +"atributos de clase (que , por supuesto, son compartidos entre instancias) " +"también es más rápido." #: ../Doc/library/unittest.mock.rst:2702 msgid "" "This brings up another issue. It is relatively common to provide a default " -"value of ``None`` for members that will later be an object of a different " -"type. ``None`` would be useless as a spec because it wouldn't let you access " -"*any* attributes or methods on it. As ``None`` is *never* going to be useful " -"as a spec, and probably indicates a member that will normally of some other " -"type, autospec doesn't use a spec for members that are set to ``None``. " -"These will just be ordinary mocks (well - MagicMocks):" -msgstr "" +"value of ``None`` for members that will later be an object of a different type. " +"``None`` would be useless as a spec because it wouldn't let you access *any* " +"attributes or methods on it. As ``None`` is *never* going to be useful as a " +"spec, and probably indicates a member that will normally of some other type, " +"autospec doesn't use a spec for members that are set to ``None``. These will " +"just be ordinary mocks (well - MagicMocks):" +msgstr "" +"Esto nos plantea otro problema. Es relativamente común proporcionar un valor " +"predeterminado de ``None`` para los miembros que posteriormente se convertirán " +"en objetos de un tipo diferente. ``None`` es inútil como especificación dado " +"que no permite acceder a *ningún* atributo o método. Como ``None`` *nunca* será " +"útil como especificación, y probablemente indica un miembro que normalmente " +"será de algún otro tipo, la autoespecificación no usa una especificación para " +"aquellos miembros configurados con ``None`` como valor. Estos serán simplemente " +"objetos simulados ordinarios (MagicMocks en realidad):" #: ../Doc/library/unittest.mock.rst:2717 msgid "" -"If modifying your production classes to add defaults isn't to your liking " -"then there are more options. One of these is simply to use an instance as " -"the spec rather than the class. The other is to create a subclass of the " -"production class and add the defaults to the subclass without affecting the " -"production class. Both of these require you to use an alternative object as " -"the spec. Thankfully :func:`patch` supports this - you can simply pass the " -"alternative object as the *autospec* argument::" -msgstr "" +"If modifying your production classes to add defaults isn't to your liking then " +"there are more options. One of these is simply to use an instance as the spec " +"rather than the class. The other is to create a subclass of the production " +"class and add the defaults to the subclass without affecting the production " +"class. Both of these require you to use an alternative object as the spec. " +"Thankfully :func:`patch` supports this - you can simply pass the alternative " +"object as the *autospec* argument::" +msgstr "" +"Si modificar tus clases en producción para agregar valores predeterminados no " +"es de tu agrado, dispones de otras opciones. Una de ellas es simplemente usar " +"una instancia como especificación en lugar de la clase. La otra es crear una " +"subclase de la clase en producción y agregar los valores predeterminados a la " +"subclase sin afectar la clase en producción. Ambas alternativas requieren que " +"uses un objeto alternativo como especificación. Afortunadamente :func:`patch` " +"admite esto; simplemente puedes pasar el objeto alternativo mediante el " +"argumento *autospec*:" #: ../Doc/library/unittest.mock.rst:2738 msgid "" -"This only applies to classes or already instantiated objects. Calling a " -"mocked class to create a mock instance *does not* create a real instance. It " -"is only attribute lookups - along with calls to :func:`dir` - that are done." +"This only applies to classes or already instantiated objects. Calling a mocked " +"class to create a mock instance *does not* create a real instance. It is only " +"attribute lookups - along with calls to :func:`dir` - that are done." msgstr "" +"Esto sólo se aplica a las clases u objetos ya instanciados. Llamar a una clase " +"simulada para crear una instancia simulada *no* crea una instancia real. Solo " +"se llevan a cabo las búsqueda de atributos (mediante llamadas a :func:`dir`)." #: ../Doc/library/unittest.mock.rst:2743 msgid "Sealing mocks" -msgstr "" +msgstr "Sellar objetos simulados" #: ../Doc/library/unittest.mock.rst:2752 msgid "" -"Seal will disable the automatic creation of mocks when accessing an " -"attribute of the mock being sealed or any of its attributes that are already " -"mocks recursively." +"Seal will disable the automatic creation of mocks when accessing an attribute " +"of the mock being sealed or any of its attributes that are already mocks " +"recursively." msgstr "" +"Seal desactivará la creación automática de objetos simulados al acceder a un " +"atributo del objeto simulado que está siendo sellado o cualquiera de sus " +"atributos que ya sean objetos simulados de forma recursiva." #: ../Doc/library/unittest.mock.rst:2755 msgid "" -"If a mock instance with a name or a spec is assigned to an attribute it " -"won't be considered in the sealing chain. This allows one to prevent seal " -"from fixing part of the mock object. ::" +"If a mock instance with a name or a spec is assigned to an attribute it won't " +"be considered in the sealing chain. This allows one to prevent seal from fixing " +"part of the mock object. ::" msgstr "" +"Si una instancia simulada con un nombre o una especificación es asignada a un " +"atributo no será considerada en la cadena de sellado. Esto permite evitar que " +"seal fije partes del objeto simulado. ::" From 9ee0a18326f4973a165c01262c67dc5be2f27e95 Mon Sep 17 00:00:00 2001 From: fjsevilla-dev Date: Sat, 3 Oct 2020 23:57:31 +0200 Subject: [PATCH 02/10] =?UTF-8?q?Agregados=20t=C3=A9rminos=20al=20dicciona?= =?UTF-8?q?rio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dictionaries/library_unittest.mock.txt | 25 + library/unittest.mock.po | 1964 ++++++++++++------------ 2 files changed, 1030 insertions(+), 959 deletions(-) diff --git a/dictionaries/library_unittest.mock.txt b/dictionaries/library_unittest.mock.txt index e69de29bb2..7a7aeb7b41 100644 --- a/dictionaries/library_unittest.mock.txt +++ b/dictionaries/library_unittest.mock.txt @@ -0,0 +1,25 @@ +Aserta +asertar +autospec +autoespecificación +Autoespecificación +backport +configurarlos +desparchear +introspeccionará +MagicMock +mock +parcheadores +Parcheadores +patch +Patch +preconfigurados +refactorizas +seal +Seal +síncronas +sizeof +start +stop +stubs + diff --git a/library/unittest.mock.po b/library/unittest.mock.po index e2853b4002..71ed369998 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -11,7 +11,7 @@ msgstr "" "Project-Id-Version: Python 3.8\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-05-05 12:54+0200\n" -"PO-Revision-Date: 2020-10-03 11:06+0200\n" +"PO-Revision-Date: 2020-10-03 23:50+0200\n" "Language-Team: python-doc-es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -24,7 +24,7 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:3 msgid ":mod:`unittest.mock` --- mock object library" -msgstr "Biblioteca de objetos simulados" +msgstr ":mod:`unittest.mock` --- Biblioteca de objetos simulados" #: ../Doc/library/unittest.mock.rst:13 msgid "**Source code:** :source:`Lib/unittest/mock.py`" @@ -37,46 +37,46 @@ msgid "" "about how they have been used." msgstr "" ":mod:`unittest.mock` es una biblioteca para pruebas de software en Python. Te " -"permite reemplazar partes del sistema bajo prueba con objetos simulados y hacer " -"aserciones sobre cómo se han utilizado." +"permite reemplazar partes del sistema bajo prueba con objetos simulados y " +"hacer aserciones sobre cómo se han utilizado." #: ../Doc/library/unittest.mock.rst:21 msgid "" ":mod:`unittest.mock` provides a core :class:`Mock` class removing the need to " -"create a host of stubs throughout your test suite. After performing an action, " -"you can make assertions about which methods / attributes were used and " -"arguments they were called with. You can also specify return values and set " -"needed attributes in the normal way." +"create a host of stubs throughout your test suite. After performing an " +"action, you can make assertions about which methods / attributes were used " +"and arguments they were called with. You can also specify return values and " +"set needed attributes in the normal way." msgstr "" "El módulo :mod:`unittest.mock` proporciona una clase principal :class:`Mock` " -"eliminando la necesidad de crear una gran cantidad de stubs en todo el conjunto " -"de pruebas. Después de realizar una determinada acción, puedes hacer aserciones " -"sobre qué métodos/atributos se usaron y los argumentos con los que se llamaron. " -"También puedes especificar valores de retorno y establecer los atributos " -"necesarios de la forma habitual." +"eliminando la necesidad de crear una gran cantidad de stubs en todo el " +"conjunto de pruebas. Después de realizar una determinada acción, puedes hacer " +"aserciones sobre qué métodos/atributos se usaron y los argumentos con los que " +"se llamaron. También puedes especificar valores de retorno y establecer los " +"atributos necesarios de la forma habitual." #: ../Doc/library/unittest.mock.rst:27 msgid "" "Additionally, mock provides a :func:`patch` decorator that handles patching " -"module and class level attributes within the scope of a test, along with :const:" -"`sentinel` for creating unique objects. See the `quick guide`_ for some " +"module and class level attributes within the scope of a test, along with :" +"const:`sentinel` for creating unique objects. See the `quick guide`_ for some " "examples of how to use :class:`Mock`, :class:`MagicMock` and :func:`patch`." msgstr "" "Además, mock proporciona un decorador :func:`patch` que puede manejar el " -"parcheo de atributos de clase y a nivel de módulo dentro del ámbito de una " -"prueba, junto con :const:`sentinel` para crear objetos únicos. Consulta la " -"`quick guide`_ para ver algunos ejemplos de cómo utilizar :class:`Mock`, :class:" -"`MagicMock` y :func:`patch`." +"parcheo de atributos a nivel de clase y de módulo dentro del ámbito de una " +"prueba, junto con :const:`sentinel` para crear objetos únicos. Consulta " +"`quick guide`_ para ver algunos ejemplos de cómo utilizar :class:`Mock`, :" +"class:`MagicMock` y :func:`patch`." #: ../Doc/library/unittest.mock.rst:33 msgid "" -"Mock is very easy to use and is designed for use with :mod:`unittest`. Mock is " -"based on the 'action -> assertion' pattern instead of 'record -> replay' used " -"by many mocking frameworks." +"Mock is very easy to use and is designed for use with :mod:`unittest`. Mock " +"is based on the 'action -> assertion' pattern instead of 'record -> replay' " +"used by many mocking frameworks." msgstr "" -"Mock es muy fácil de usar y está diseñado para ser utilizado con :mod:" -"`unittest`. Mock se basa en el patrón 'acción -> aserción' en lugar de usar el " -"patrón 'grabación -> reproducción' utilizado por muchos frameworks de " +"Mock es muy fácil de usar y está diseñado para ser utilizado junto a :mod:" +"`unittest`. Mock se basa en el patrón 'acción -> aserción' en lugar de usar " +"el patrón 'grabación -> reproducción' utilizado por muchos frameworks de " "simulación." #: ../Doc/library/unittest.mock.rst:37 @@ -85,7 +85,7 @@ msgid "" "available as `mock on PyPI `_." msgstr "" "Hay un backport del módulo :mod:`unittest.mock` para versiones anteriores de " -"Python, `disponible en PyPI `_." +"Python `disponible en PyPI `_." #: ../Doc/library/unittest.mock.rst:42 msgid "Quick Guide" @@ -93,61 +93,62 @@ msgstr "Guía rápida" #: ../Doc/library/unittest.mock.rst:60 msgid "" -":class:`Mock` and :class:`MagicMock` objects create all attributes and methods " -"as you access them and store details of how they have been used. You can " -"configure them, to specify return values or limit what attributes are " +":class:`Mock` and :class:`MagicMock` objects create all attributes and " +"methods as you access them and store details of how they have been used. You " +"can configure them, to specify return values or limit what attributes are " "available, and then make assertions about how they have been used:" msgstr "" -"La objetos de las clases :class:`Mock` y :class:`MagicMock` van creando todos " -"los atributos y métodos a medida que se accede a ellos y almacenan los detalles " -"de cómo se han utilizado. Puedes configurarlos para especificar valores de " -"retorno o limitar qué atributos están disponibles y luego hacer aserciones " -"sobre cómo se han utilizado:" +"Los objetos de las clases :class:`Mock` y :class:`MagicMock` van creando " +"todos los atributos y métodos a medida que se accede a ellos y almacenan " +"detalles de cómo se han utilizado. Puedes configurarlos para especificar " +"valores de retorno o limitar qué atributos están disponibles y posteriormente " +"hacer aserciones sobre cómo han sido utilizados:" #: ../Doc/library/unittest.mock.rst:72 msgid "" ":attr:`side_effect` allows you to perform side effects, including raising an " "exception when a mock is called:" msgstr "" -":attr:`side_effect` te permite implementar efectos colaterales, lo que incluye " -"lanzar una excepción cuando se llama a un objeto simulado:" +":attr:`side_effect` te permite implementar efectos colaterales, lo que " +"incluye lanzar una excepción cuando se llama a un objeto simulado:" #: ../Doc/library/unittest.mock.rst:92 msgid "" "Mock has many other ways you can configure it and control its behaviour. For " -"example the *spec* argument configures the mock to take its specification from " -"another object. Attempting to access attributes or methods on the mock that " -"don't exist on the spec will fail with an :exc:`AttributeError`." +"example the *spec* argument configures the mock to take its specification " +"from another object. Attempting to access attributes or methods on the mock " +"that don't exist on the spec will fail with an :exc:`AttributeError`." msgstr "" "Existen muchas otras formas de configurar y controlar el comportamiento de " "Mock. Por ejemplo, el argumento *spec* configura el objeto simulado para que " -"tome su especificación de otro objeto. El intento de acceder a atributos o " -"métodos en el objeto simulado que no existen en la especificación fallará con " -"una excepción :exc:`AttributeError`." +"tome su especificación de otro objeto. Cualquier intento de acceder a " +"atributos o métodos en el objeto simulado que no existan en la especificación " +"fallará lanzando una excepción :exc:`AttributeError`." #: ../Doc/library/unittest.mock.rst:97 msgid "" -"The :func:`patch` decorator / context manager makes it easy to mock classes or " -"objects in a module under test. The object you specify will be replaced with a " -"mock (or other object) during the test and restored when the test ends::" +"The :func:`patch` decorator / context manager makes it easy to mock classes " +"or objects in a module under test. The object you specify will be replaced " +"with a mock (or other object) during the test and restored when the test " +"ends::" msgstr "" -"El decorador :func:`patch` / administrador de contexto facilita la simulación " -"de clases u objetos en un módulo bajo prueba. El objeto que especifiques será " -"reemplazado por un objeto simulado (u otro objeto) durante la prueba y " +"El decorador / gestor de contexto :func:`patch` facilita la simulación de " +"clases u objetos en un módulo bajo prueba. El objeto que especifiques será " +"reemplazado por un objeto simulado (u otro objeto) durante la prueba y será " "restaurado cuando esta finalice:" #: ../Doc/library/unittest.mock.rst:116 msgid "" "When you nest patch decorators the mocks are passed in to the decorated " "function in the same order they applied (the normal *Python* order that " -"decorators are applied). This means from the bottom up, so in the example above " -"the mock for ``module.ClassName1`` is passed in first." +"decorators are applied). This means from the bottom up, so in the example " +"above the mock for ``module.ClassName1`` is passed in first." msgstr "" "Cuando anidas decoradores de parcheo, los objetos simulados se pasan a la " -"función decorada en el mismo orden en que se aplicaron (el orden normal en el " -"que se aplican los decoradores en *Python*). Esto significa de abajo hacia " -"arriba, por lo que en el ejemplo anterior se pasa primero el objeto simulado " -"para ``module.ClassName1``." +"función decorada en el mismo orden en el que fueron aplicados (el orden " +"normal en el que se aplican los decoradores en *Python*). Esto significa de " +"abajo hacia arriba, por lo que en el ejemplo anterior se pasa primero el " +"objeto simulado para ``module.ClassName1``." #: ../Doc/library/unittest.mock.rst:121 msgid "" @@ -155,25 +156,26 @@ msgid "" "they are looked up. This is normally straightforward, but for a quick guide " "read :ref:`where to patch `." msgstr "" -"Al usar :func: `patch` es importante que parchees los objetos en el espacio de " +"Al usar :func:`patch` es importante que parchees los objetos en el espacio de " "nombres donde son buscados. Esto normalmente es sencillo, pero para una guía " "rápida, lee :ref:`dónde parchear `." #: ../Doc/library/unittest.mock.rst:125 msgid "" -"As well as a decorator :func:`patch` can be used as a context manager in a with " -"statement:" +"As well as a decorator :func:`patch` can be used as a context manager in a " +"with statement:" msgstr "" -"Además de como un decorador, lafunción :func:`patch` se puede usar como " -"administrador de contexto en una declaración with:" +"Además de como decorador, la función :func:`patch` se puede usar como gestor " +"de contexto en una declaración with:" #: ../Doc/library/unittest.mock.rst:135 msgid "" -"There is also :func:`patch.dict` for setting values in a dictionary just during " -"a scope and restoring the dictionary to its original state when the test ends:" +"There is also :func:`patch.dict` for setting values in a dictionary just " +"during a scope and restoring the dictionary to its original state when the " +"test ends:" msgstr "" -"También existe la función :func:`patch.dict` que permite establecer valores en " -"un diccionario dentro de un ámbito y restaurar el diccionario a su estado " +"También existe la función :func:`patch.dict` que permite establecer valores " +"en un diccionario dentro de un ámbito y restaurar el diccionario a su estado " "original cuando finaliza la prueba:" #: ../Doc/library/unittest.mock.rst:146 @@ -183,24 +185,26 @@ msgid "" "allows you to do things like:" msgstr "" "Mock admite la simulación de los :ref:`métodos mágicos ` de " -"Python. La forma más sencilla de utilizar métodos mágicos es mediante la clase :" -"class:`MagicMock`. Te permite hacer cosas como:" +"Python. La forma más sencilla de utilizar métodos mágicos es mediante la " +"clase :class:`MagicMock`. Te permite hacer cosas como:" #: ../Doc/library/unittest.mock.rst:156 msgid "" -"Mock allows you to assign functions (or other Mock instances) to magic methods " -"and they will be called appropriately. The :class:`MagicMock` class is just a " -"Mock variant that has all of the magic methods pre-created for you (well, all " -"the useful ones anyway)." +"Mock allows you to assign functions (or other Mock instances) to magic " +"methods and they will be called appropriately. The :class:`MagicMock` class " +"is just a Mock variant that has all of the magic methods pre-created for you " +"(well, all the useful ones anyway)." msgstr "" "Mock también permite asignar funciones (u otras instancias de Mock) a métodos " -"mágicos y se asegura de que serán llamadas de forma apropiada. La clase :class:" -"`MagicMock` es solo una variante de Mock que tiene todos los métodos mágicos " -"previamente creados para ti (bueno, todos los que son útiles)." +"mágicos y se asegura de que serán llamadas de forma apropiada. La clase :" +"class:`MagicMock` es solo una variante de Mock con la diferencia de que tiene " +"todos los métodos mágicos previamente creados para ti (bueno, todos los que " +"son útiles)." #: ../Doc/library/unittest.mock.rst:161 msgid "" -"The following is an example of using magic methods with the ordinary Mock class:" +"The following is an example of using magic methods with the ordinary Mock " +"class:" msgstr "" "El siguiente es un ejemplo de uso de métodos mágicos utilizando la clase Mock " "ordinaria:" @@ -212,25 +216,25 @@ msgid "" "Auto-speccing can be done through the *autospec* argument to patch, or the :" "func:`create_autospec` function. Auto-speccing creates mock objects that have " "the same attributes and methods as the objects they are replacing, and any " -"functions and methods (including constructors) have the same call signature as " -"the real object." -msgstr "" -"Para asegurarte de que los objetos simulados en tus pruebas tienen la misma API " -"que los objetos que están reemplazando, puedes usar ref:`autoespecialización " -"`. La autoespecialización se puede hacer a través del argumento " -"*autospec* de patch, o mediante la función :func:`create_autospec`. La " -"autoespecialización crea objetos simulados que tienen los mismos atributos y " -"métodos que los objetos que están reemplazando, y todas las función y métodos " -"(incluidos los constructores) tienen la misma firma de llamada que los objetos " -"reales." +"functions and methods (including constructors) have the same call signature " +"as the real object." +msgstr "" +"Para asegurarte de que los objetos simulados en tus pruebas tienen " +"exactamente la misma API que los objetos que están reemplazando, puedes usar :" +"ref:`autoespecificación `. La autoespecificación se puede " +"realizar a través del argumento *autospec* de patch, o mediante la función :" +"func:`create_autospec`. La autoespecificación crea objetos simulados que " +"tienen los mismos atributos y métodos que los objetos que están reemplazando, " +"y todas las función y métodos (incluidos los constructores) tienen la misma " +"firma de llamada que los objetos reales." #: ../Doc/library/unittest.mock.rst:177 msgid "" -"This ensures that your mocks will fail in the same way as your production code " -"if they are used incorrectly:" +"This ensures that your mocks will fail in the same way as your production " +"code if they are used incorrectly:" msgstr "" -"Esto asegura que tus simulaciones fallarán si se utilizan incorrectamente de la " -"misma manera que tu código de producción:" +"Esto asegura que tus simulaciones fallarán, si se utilizan incorrectamente, " +"de la misma manera que lo haría tu código en producción:" #: ../Doc/library/unittest.mock.rst:193 msgid "" @@ -249,42 +253,42 @@ msgstr "La clase Mock" #: ../Doc/library/unittest.mock.rst:211 msgid "" ":class:`Mock` is a flexible mock object intended to replace the use of stubs " -"and test doubles throughout your code. Mocks are callable and create attributes " -"as new mocks when you access them [#]_. Accessing the same attribute will " -"always return the same mock. Mocks record how you use them, allowing you to " -"make assertions about what your code has done to them." -msgstr "" -":class:`Mock` es un objeto simulado flexible, destinado a reemplazar el uso de " -"stubs y dobles de prueba en todo tu código. Los objetos Mock son invocables y " -"crean atributos en el mismo momento que se accede a ellos como nuevos objetos " -"Mock [#]_. Acceder al mismo atributo siempre retornará el mismo objeto Mock. " -"Además registran cómo los usas, lo que te permite hacer aserciones sobre cómo " -"tu código ha interaccionado con ellos." +"and test doubles throughout your code. Mocks are callable and create " +"attributes as new mocks when you access them [#]_. Accessing the same " +"attribute will always return the same mock. Mocks record how you use them, " +"allowing you to make assertions about what your code has done to them." +msgstr "" +":class:`Mock` es un objeto simulado flexible, destinado a reemplazar el uso " +"de stubs y dobles de prueba en todo tu código. Los objetos Mock son " +"invocables y crean atributos en el mismo momento que se accede a ellos como " +"nuevos objetos Mock [#]_. Acceder al mismo atributo siempre retornará el " +"mismo objeto Mock. Además, registran cómo los usas, lo que te permite hacer " +"aserciones sobre cómo tu código ha interaccionado con ellos." #: ../Doc/library/unittest.mock.rst:217 msgid "" ":class:`MagicMock` is a subclass of :class:`Mock` with all the magic methods " -"pre-created and ready to use. There are also non-callable variants, useful when " -"you are mocking out objects that aren't callable: :class:`NonCallableMock` and :" -"class:`NonCallableMagicMock`" +"pre-created and ready to use. There are also non-callable variants, useful " +"when you are mocking out objects that aren't callable: :class:" +"`NonCallableMock` and :class:`NonCallableMagicMock`" msgstr "" ":class:`MagicMock` es una subclase de :class:`Mock` con todos los métodos " -"mágicos creados previamente y listos para ser usados. También hay variantes no " -"invocables, útiles cuando se están simulando objetos que no se pueden llamar: :" -"class:`NonCallableMock` y :class:`NonCallableMagicMock`" +"mágicos creados previamente y listos para ser usados. También hay variantes " +"no invocables, útiles cuando se están simulando objetos que no se pueden " +"llamar: :class:`NonCallableMock` y :class:`NonCallableMagicMock`" #: ../Doc/library/unittest.mock.rst:222 msgid "" -"The :func:`patch` decorators makes it easy to temporarily replace classes in a " -"particular module with a :class:`Mock` object. By default :func:`patch` will " -"create a :class:`MagicMock` for you. You can specify an alternative class of :" -"class:`Mock` using the *new_callable* argument to :func:`patch`." +"The :func:`patch` decorators makes it easy to temporarily replace classes in " +"a particular module with a :class:`Mock` object. By default :func:`patch` " +"will create a :class:`MagicMock` for you. You can specify an alternative " +"class of :class:`Mock` using the *new_callable* argument to :func:`patch`." msgstr "" -"Los decoradores :func:`patch` facilitan la sustitución temporal de clases en un " -"módulo en particular con un objeto :class:`Mock`. Por defecto :func:`patch` " -"creará un objeto :class:`MagicMock` automáticamente. Se puede especificar una " -"clase alternativa a :class:`Mock` usando el argumento *new_callable* de :func:" -"`patch`." +"Los decoradores :func:`patch` facilitan la sustitución temporal de clases en " +"un módulo en particular con un objeto :class:`Mock`. Por defecto, :func:" +"`patch` creará un objeto :class:`MagicMock` automáticamente. Se puede " +"especificar una clase alternativa a :class:`Mock` usando el argumento " +"*new_callable* de :func:`patch`." #: ../Doc/library/unittest.mock.rst:230 msgid "" @@ -296,18 +300,18 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:233 msgid "" -"*spec*: This can be either a list of strings or an existing object (a class or " -"instance) that acts as the specification for the mock object. If you pass in an " -"object then a list of strings is formed by calling dir on the object (excluding " -"unsupported magic attributes and methods). Accessing any attribute not in this " -"list will raise an :exc:`AttributeError`." +"*spec*: This can be either a list of strings or an existing object (a class " +"or instance) that acts as the specification for the mock object. If you pass " +"in an object then a list of strings is formed by calling dir on the object " +"(excluding unsupported magic attributes and methods). Accessing any attribute " +"not in this list will raise an :exc:`AttributeError`." msgstr "" -"*spec*: puede ser una lista de cadenas de caracteres o un objeto existente " +"*spec*: Puede ser una lista de cadenas de caracteres o un objeto existente " "previamente (una clase o una instancia) que actúa como la especificación del " "objeto simulado. Si pasas un objeto, se forma una lista de cadenas llamando a " "la función *dir* en el objeto (excluyendo los métodos y atributos mágicos no " -"admitidos). Acceder a cualquier atributo que no esté en esta lista generará una " -"excepción :exc:`AttributeError`." +"admitidos). Acceder a cualquier atributo que no esté en esta lista generará " +"una excepción :exc:`AttributeError`." #: ../Doc/library/unittest.mock.rst:239 msgid "" @@ -315,9 +319,9 @@ msgid "" "__class__` returns the class of the spec object. This allows mocks to pass :" "func:`isinstance` tests." msgstr "" -"Si *spec* es un objeto (en lugar de una lista de cadenas de caracteres), :attr:" -"`~instance.__class__` retorna la clase del objeto especificado. Esto permite " -"que los objetos simulados pasen las pruebas :func:`isinstance`." +"Si *spec* es un objeto (en lugar de una lista de cadenas de caracteres), :" +"attr:`~instance.__class__` retorna la clase del objeto especificado. Esto " +"permite que los objetos simulados pasen las pruebas de :func:`isinstance`." #: ../Doc/library/unittest.mock.rst:243 msgid "" @@ -327,51 +331,53 @@ msgid "" msgstr "" "*spec_set*: Una variante más estricta de *spec*. Si se utiliza, cualquier " "intento de *establecer* u obtener un atributo del objeto simulado que no esté " -"en el objeto pasado como *spec_set* lanzará una excepción :exc:`AttributeError`." +"en el objeto pasado como *spec_set* lanzará una excepción :exc:" +"`AttributeError`." #: ../Doc/library/unittest.mock.rst:247 msgid "" "*side_effect*: A function to be called whenever the Mock is called. See the :" "attr:`~Mock.side_effect` attribute. Useful for raising exceptions or " "dynamically changing return values. The function is called with the same " -"arguments as the mock, and unless it returns :data:`DEFAULT`, the return value " -"of this function is used as the return value." +"arguments as the mock, and unless it returns :data:`DEFAULT`, the return " +"value of this function is used as the return value." msgstr "" "*side_effect*: Una función que se llamará cada vez que el objeto simulado sea " -"llamado. Consultar el atributo :attr:`~Mock.side_effect` para más información. " -"Es útil para lanzar excepciones o para cambiar dinámicamente valores de " -"retorno. La función se llama con los mismos argumentos que el objeto simulado, " -"y a menos que retorne :data:`DEFAULT`, su valor de retorno se utiliza como " -"valor de retorno del propio objeto simulado." +"llamado. Consultar el atributo :attr:`~Mock.side_effect` para más " +"información. Es útil para lanzar excepciones o para cambiar dinámicamente " +"valores de retorno. La función se llama con los mismos argumentos que el " +"objeto simulado, y a menos que retorne :data:`DEFAULT`, su valor de retorno " +"se utiliza como valor de retorno del propio objeto simulado." #: ../Doc/library/unittest.mock.rst:253 msgid "" -"Alternatively *side_effect* can be an exception class or instance. In this case " -"the exception will be raised when the mock is called." +"Alternatively *side_effect* can be an exception class or instance. In this " +"case the exception will be raised when the mock is called." msgstr "" -"Alternativamente *side_effect* puede ser una clase o instancia de excepción. En " -"este caso se lanza la excepción cuando el objeto simulado es llamado." +"Alternativamente *side_effect* puede ser una clase o instancia de excepción. " +"En este caso, se lanza la excepción cuando se llama al objeto simulado." #: ../Doc/library/unittest.mock.rst:256 msgid "" -"If *side_effect* is an iterable then each call to the mock will return the next " -"value from the iterable." +"If *side_effect* is an iterable then each call to the mock will return the " +"next value from the iterable." msgstr "" "Si *side_effect* es un iterable, cada llamada al objeto simulado retornará el " "siguiente valor del iterable." #: ../Doc/library/unittest.mock.rst:259 msgid "A *side_effect* can be cleared by setting it to ``None``." -msgstr "Un *side_effect* se puede borrar estableciéndolo en ``None``." +msgstr "Un *side_effect* se puede desactivar estableciéndolo en ``None``." #: ../Doc/library/unittest.mock.rst:261 msgid "" -"*return_value*: The value returned when the mock is called. By default this is " -"a new Mock (created on first access). See the :attr:`return_value` attribute." +"*return_value*: The value returned when the mock is called. By default this " +"is a new Mock (created on first access). See the :attr:`return_value` " +"attribute." msgstr "" "*return_value*: El valor retornado cuando se llama al objeto simulado. Por " -"defecto, esta es una nueva instancia de Mock (creada en el primer acceso). " -"Consultar el atributo :attr:`return_value` para más detalles." +"defecto, este es una nueva instancia de la clase Mock (creada en el primer " +"acceso). Consultar el atributo :attr:`return_value` para más detalles." #: ../Doc/library/unittest.mock.rst:265 msgid "" @@ -380,7 +386,7 @@ msgid "" "these attributes." msgstr "" "*unsafe*: Por defecto, si cualquier atributo comienza con *assert* o *assret* " -"se lanza una excepción :exc:`AttributeError` si se intenta acceder a ellos. " +"y se intenta acceder a él, se lanza una excepción :exc:`AttributeError`. " "Pasar ``unsafe=True`` permitirá el acceso a estos atributos." #: ../Doc/library/unittest.mock.rst:271 @@ -391,20 +397,21 @@ msgid "" "wraps the corresponding attribute of the wrapped object (so attempting to " "access an attribute that doesn't exist will raise an :exc:`AttributeError`)." msgstr "" -"*wraps*: objeto a envolver (simular) por la instancia de Mock. Si *wraps* no es " -"``None``, la llamada al objeto Mock pasa a su vez la llamada a través del " -"objeto envuelto (retornando el resultado real). Acceder a un atributo del " -"objeto simulado retornará otro objeto Mock que envuelve al atributo " -"correspondiente del objeto real envuelto (de modo que intentar acceder a un " -"atributo que no existe lanzará una excepción :exc:`AttributeError`)." +"*wraps*: objeto a envolver (simular) por la instancia de Mock. Si *wraps* no " +"es ``None``, al llamar al objeto Mock se pasa la llamada a través del objeto " +"envuelto (retornando el resultado real). Acceder a un atributo del objeto " +"simulado retornará otro objeto Mock que envuelve al atributo correspondiente " +"del objeto real envuelto (de modo que intentar acceder a un atributo que no " +"existe lanzará una excepción :exc:`AttributeError`)." #: ../Doc/library/unittest.mock.rst:278 msgid "" -"If the mock has an explicit *return_value* set then calls are not passed to the " -"wrapped object and the *return_value* is returned instead." +"If the mock has an explicit *return_value* set then calls are not passed to " +"the wrapped object and the *return_value* is returned instead." msgstr "" "Si el objeto simulado tiene un *return_value* explícito establecido, las " -"llamadas no se pasan al objeto envuelto y *return_value* se retorna en su lugar." +"llamadas no se pasan al objeto envuelto y *return_value* se retorna en su " +"lugar." #: ../Doc/library/unittest.mock.rst:281 msgid "" @@ -412,8 +419,8 @@ msgid "" "This can be useful for debugging. The name is propagated to child mocks." msgstr "" "*name*: Si el objeto simulado tiene un nombre, será utilizado en la " -"representación imprimible del mismo. Esto puede ser útil para la depuración. El " -"nombre se propaga a los objetos simulados hijos." +"representación imprimible del mismo. Esto puede ser útil para la depuración. " +"El nombre se propaga a los objetos simulados hijos." #: ../Doc/library/unittest.mock.rst:285 msgid "" @@ -423,8 +430,8 @@ msgid "" msgstr "" "Los objetos simulados también pueden ser llamados con argumentos por palabra " "clave arbitrarios. Estos serán utilizados para establecer atributos en el " -"objeto simulado una vez creado. Consultar el método :meth:`configure_mock` para " -"más detalles." +"objeto simulado una vez creado. Consultar el método :meth:`configure_mock` " +"para más detalles." #: ../Doc/library/unittest.mock.rst:291 msgid "Assert that the mock was called at least once." @@ -447,32 +454,33 @@ msgid "" "Assert that the mock was called exactly once and that that call was with the " "specified arguments." msgstr "" -"Aserta si el objeto simulado se ha llamado exactamente una vez y que esa " +"Aserta si el objeto simulado se ha llamado exactamente una vez y si esa " "llamada se realizó con los argumentos especificados." #: ../Doc/library/unittest.mock.rst:345 msgid "assert the mock has been called with the specified arguments." msgstr "" -"aserta si el objeto simulado se ha llamado con los argumentos especificados." +"Aserta si el objeto simulado se ha llamado con los argumentos especificados." #: ../Doc/library/unittest.mock.rst:347 msgid "" "The assert passes if the mock has *ever* been called, unlike :meth:" -"`assert_called_with` and :meth:`assert_called_once_with` that only pass if the " -"call is the most recent one, and in the case of :meth:`assert_called_once_with` " -"it must also be the only call." +"`assert_called_with` and :meth:`assert_called_once_with` that only pass if " +"the call is the most recent one, and in the case of :meth:" +"`assert_called_once_with` it must also be the only call." msgstr "" "La aserción pasa si el objeto simulado se ha llamado *en algún momento*, a " -"diferencia de :meth:`assert_called_with` y :meth:`assert_called_once_with`, con " -"los que sólo pasa la aserción si la llamada es la más reciente, y en el caso " -"de :meth:`assert_called_once_with` también debe ser la única llamada realizada." +"diferencia de :meth:`assert_called_with` y :meth:`assert_called_once_with`, " +"con los que sólo pasa la aserción si la llamada es la más reciente, y en el " +"caso de :meth:`assert_called_once_with` también debe ser la única llamada " +"realizada." #: ../Doc/library/unittest.mock.rst:360 msgid "" "assert the mock has been called with the specified calls. The :attr:" "`mock_calls` list is checked for the calls." msgstr "" -"aserta si el objeto simulado se ha llamado con las llamadas especificadas. La " +"Aserta si el objeto simulado se ha llamado con las llamadas especificadas. La " "lista :attr:`mock_calls` se compara con la lista de llamadas." #: ../Doc/library/unittest.mock.rst:363 @@ -480,20 +488,21 @@ msgid "" "If *any_order* is false then the calls must be sequential. There can be extra " "calls before or after the specified calls." msgstr "" -"Si *any_order* es falso entonces las llamadas deben ser secuenciales. No puede " -"haber llamadas adicionales antes o después de las llamadas especificadas." +"Si *any_order* es falso entonces las llamadas deben ser secuenciales. No " +"puede haber llamadas adicionales antes o después de las llamadas " +"especificadas." #: ../Doc/library/unittest.mock.rst:367 msgid "" "If *any_order* is true then the calls can be in any order, but they must all " "appear in :attr:`mock_calls`." msgstr "" -"Si *any_order* es verdadero, las llamadas pueden estar en cualquier orden, pero " -"deben aparecer todas en :attr:`mock_calls`." +"Si *any_order* es verdadero, las llamadas pueden estar en cualquier orden, " +"pero deben aparecer todas en :attr:`mock_calls`." #: ../Doc/library/unittest.mock.rst:382 msgid "Assert the mock was never called." -msgstr "Aserta si el mock nunca fue llamado." +msgstr "Aserta si el objeto simulado nunca fue llamado." #: ../Doc/library/unittest.mock.rst:397 msgid "The reset_mock method resets all the call attributes on a mock object:" @@ -507,20 +516,20 @@ msgstr "Añadidos dos argumentos por palabra clave a la función *reset_mock*." #: ../Doc/library/unittest.mock.rst:410 msgid "" -"This can be useful where you want to make a series of assertions that reuse the " -"same object. Note that :meth:`reset_mock` *doesn't* clear the return value, :" -"attr:`side_effect` or any child attributes you have set using normal assignment " -"by default. In case you want to reset *return_value* or :attr:`side_effect`, " -"then pass the corresponding parameter as ``True``. Child mocks and the return " -"value mock (if any) are reset as well." +"This can be useful where you want to make a series of assertions that reuse " +"the same object. Note that :meth:`reset_mock` *doesn't* clear the return " +"value, :attr:`side_effect` or any child attributes you have set using normal " +"assignment by default. In case you want to reset *return_value* or :attr:" +"`side_effect`, then pass the corresponding parameter as ``True``. Child mocks " +"and the return value mock (if any) are reset as well." msgstr "" "Esto puede ser útil cuando se quiere hacer una serie de aserciones que " "reutilizan el mismo objeto. Ten en cuenta que por defecto :meth:`reset_mock` " -"*no* borra el valor de retorno, :attr:`side_effect` o cualquier atributo hijo " -"que hayas establecido mediante asignación normal. En caso de que quieras " +"*no* borra el valor de retorno, :attr:`side_effect`, ni cualquier atributo " +"hijo que hayas establecido mediante asignación normal. En caso de que quieras " "restablecer *return_value* o :attr:`side_effect`, debes pasar el parámetro " -"correspondiente como ``True``. Los objetos simulados hijos y el objeto simulado " -"que conforma el valor de retorno (si los hay) se restablecen también." +"correspondiente como ``True``. Los objetos simulados hijos y el objeto " +"simulado que conforma el valor de retorno (si los hay) se restablecen también." #: ../Doc/library/unittest.mock.rst:418 msgid "*return_value*, and :attr:`side_effect` are keyword only argument." @@ -530,8 +539,8 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:424 msgid "" -"Add a spec to a mock. *spec* can either be an object or a list of strings. Only " -"attributes on the *spec* can be fetched as attributes from the mock." +"Add a spec to a mock. *spec* can either be an object or a list of strings. " +"Only attributes on the *spec* can be fetched as attributes from the mock." msgstr "" "Agrega una especificación a un objeto simulado. *spec* puede ser un objeto o " "una lista de cadenas de caracteres. Sólo los atributos presentes en *spec* " @@ -540,14 +549,14 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:428 msgid "If *spec_set* is true then only attributes on the spec can be set." msgstr "" -"Si *spec_set* es verdadero, solo los atributos de la especificación pueden ser " -"establecidos." +"Si *spec_set* es verdadero, solo los atributos de la especificación pueden " +"ser establecidos." #: ../Doc/library/unittest.mock.rst:433 msgid "" -"Attach a mock as an attribute of this one, replacing its name and parent. Calls " -"to the attached mock will be recorded in the :attr:`method_calls` and :attr:" -"`mock_calls` attributes of this one." +"Attach a mock as an attribute of this one, replacing its name and parent. " +"Calls to the attached mock will be recorded in the :attr:`method_calls` and :" +"attr:`mock_calls` attributes of this one." msgstr "" "Adjunta otro objeto simulado como un atributo de la instancia actual, " "substituyendo su nombre y su padre. Las llamadas al objeto simulado adjuntado " @@ -557,58 +566,59 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:440 msgid "Set attributes on the mock through keyword arguments." msgstr "" -"Establece los atributos del objeto simulado por medio de argumentos por palabra " -"clave." +"Establece los atributos del objeto simulado por medio de argumentos por " +"palabra clave." #: ../Doc/library/unittest.mock.rst:442 msgid "" -"Attributes plus return values and side effects can be set on child mocks using " -"standard dot notation and unpacking a dictionary in the method call:" +"Attributes plus return values and side effects can be set on child mocks " +"using standard dot notation and unpacking a dictionary in the method call:" msgstr "" "Los atributos, los valores de retorno y los efectos de colaterales se pueden " -"configurar en los objetos simulados hijos usando la notación de punto estándar " -"y desempaquetando un diccionario en la llamada al método:" +"configurar en los objetos simulados hijos usando la notación de punto " +"estándar y desempaquetando un diccionario en la llamada al método:" #: ../Doc/library/unittest.mock.rst:456 msgid "The same thing can be achieved in the constructor call to mocks:" msgstr "" -"Lo mismo se puede lograr en la llamada al constructor de los objetos simulados:" +"Lo mismo se puede lograr en la llamada al constructor de los objetos " +"simulados:" #: ../Doc/library/unittest.mock.rst:469 msgid "" ":meth:`configure_mock` exists to make it easier to do configuration after the " "mock has been created." msgstr "" -":meth:`configure_mock` existe con el fin de facilitar la configuración después " -"de que el objeto simulado haya sido creado." +":meth:`configure_mock` existe con el fin de facilitar la configuración " +"después de que el objeto simulado haya sido creado." #: ../Doc/library/unittest.mock.rst:475 msgid "" ":class:`Mock` objects limit the results of ``dir(some_mock)`` to useful " -"results. For mocks with a *spec* this includes all the permitted attributes for " -"the mock." +"results. For mocks with a *spec* this includes all the permitted attributes " +"for the mock." msgstr "" "Los objetos :class:`Mock` limitan los resultados de ``dir(some_mock)`` a " -"resultados útiles. Para los objetos simulados con una especificación (*spec*) " -"esto incluye todos los atributos permitidos para el mismo." +"resultados útiles. Para los objetos simulados con una especificación " +"(*spec*), esto incluye todos los atributos permitidos para el mismo." #: ../Doc/library/unittest.mock.rst:479 msgid "" "See :data:`FILTER_DIR` for what this filtering does, and how to switch it off." msgstr "" -"Consultar :data:`FILTER_DIR` para conocer que hace este filtrado y la forma de " -"desactivarlo." +"Consultar :data:`FILTER_DIR` para conocer que hace este filtrado y la forma " +"de desactivarlo." #: ../Doc/library/unittest.mock.rst:485 msgid "" -"Create the child mocks for attributes and return value. By default child mocks " -"will be the same type as the parent. Subclasses of Mock may want to override " -"this to customize the way child mocks are made." +"Create the child mocks for attributes and return value. By default child " +"mocks will be the same type as the parent. Subclasses of Mock may want to " +"override this to customize the way child mocks are made." msgstr "" -"Crea los objetos simulados hijos para los atributos y el valor de retorno. Por " -"defecto los objetos simulados hijos serán del mismo tipo que el padre. Las " -"subclases de Mock pueden redefinir este método para personalizar la forma en la " -"que se construye el objeto simulado hijo." +"Crea los objetos simulados hijos para los atributos y el valor de retorno. " +"Por defecto los objetos simulados hijos serán del mismo tipo que el padre. " +"Las subclases de Mock pueden redefinir este método para personalizar la forma " +"en la que se construye el objeto simulado hijo." #: ../Doc/library/unittest.mock.rst:490 msgid "" @@ -624,41 +634,43 @@ msgstr "Un booleano que representa si el objeto simulado ha sido llamado o no:" #: ../Doc/library/unittest.mock.rst:507 msgid "An integer telling you how many times the mock object has been called:" -msgstr "Un entero que le dice cuántas veces el objeto simulado ha sido llamado:" +msgstr "" +"Un entero que le indica cuántas veces el objeto simulado ha sido llamado:" #: ../Doc/library/unittest.mock.rst:519 msgid "Set this to configure the value returned by calling the mock:" msgstr "" -"Establece éste atributo para configurar el valor a retornar cuando se llame al " -"objeto simulado:" +"Establece este atributo para configurar el valor a retornar cuando se llama " +"al objeto simulado:" #: ../Doc/library/unittest.mock.rst:526 msgid "" "The default return value is a mock object and you can configure it in the " "normal way:" msgstr "" -"El valor de retorno por defecto es un objeto simulado y se puede configurar de " -"forma habitual:" +"El valor de retorno por defecto es otro objeto simulado y se puede configurar " +"de forma habitual:" #: ../Doc/library/unittest.mock.rst:535 msgid ":attr:`return_value` can also be set in the constructor:" msgstr "" -":attr:`return_value` también se puede establecer directamente en el constructor:" +":attr:`return_value` también se puede establecer directamente en el " +"constructor:" #: ../Doc/library/unittest.mock.rst:546 msgid "" -"This can either be a function to be called when the mock is called, an iterable " -"or an exception (class or instance) to be raised." +"This can either be a function to be called when the mock is called, an " +"iterable or an exception (class or instance) to be raised." msgstr "" "Este atributo puede ser una función a ser llamada cuando se llame al objeto " "simulado, un iterable o una excepción (clase o instancia) para ser lanzada." #: ../Doc/library/unittest.mock.rst:549 msgid "" -"If you pass in a function it will be called with same arguments as the mock and " -"unless the function returns the :data:`DEFAULT` singleton the call to the mock " -"will then return whatever the function returns. If the function returns :data:" -"`DEFAULT` then the mock will return its normal value (from the :attr:" +"If you pass in a function it will be called with same arguments as the mock " +"and unless the function returns the :data:`DEFAULT` singleton the call to the " +"mock will then return whatever the function returns. If the function returns :" +"data:`DEFAULT` then the mock will return its normal value (from the :attr:" "`return_value`)." msgstr "" "Si pasas una función, será llamada con los mismos argumentos que el objeto " @@ -669,21 +681,21 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:555 msgid "" -"If you pass in an iterable, it is used to retrieve an iterator which must yield " -"a value on every call. This value can either be an exception instance to be " -"raised, or a value to be returned from the call to the mock (:data:`DEFAULT` " -"handling is identical to the function case)." +"If you pass in an iterable, it is used to retrieve an iterator which must " +"yield a value on every call. This value can either be an exception instance " +"to be raised, or a value to be returned from the call to the mock (:data:" +"`DEFAULT` handling is identical to the function case)." msgstr "" "Si pasas un iterable, se utiliza para obtener un iterador a partir del mismo " -"que debe producir un valor en cada llamada. Este valor puede ser una instancia " -"de la excepción a ser lanzada o un valor a retornar al llamar al objeto " -"simulado (el manejo de :data:`DEFAULT` es igual que en el caso de pasar una " -"función)." +"que debe producir un valor en cada llamada. Este valor puede ser una " +"instancia de la excepción a ser lanzada o un valor a retornar al llamar al " +"objeto simulado (el manejo de :data:`DEFAULT` es igual que en el caso en el " +"que se pasa una función)." #: ../Doc/library/unittest.mock.rst:560 msgid "" -"An example of a mock that raises an exception (to test exception handling of an " -"API):" +"An example of a mock that raises an exception (to test exception handling of " +"an API):" msgstr "" "Un ejemplo de un objeto simulado que genera una excepción (para probar el " "manejo de excepciones de una API):" @@ -698,11 +710,11 @@ msgstr "Usando un objeto invocable:" #: ../Doc/library/unittest.mock.rst:587 msgid "" -":attr:`side_effect` can be set in the constructor. Here's an example that adds " -"one to the value the mock is called with and returns it:" +":attr:`side_effect` can be set in the constructor. Here's an example that " +"adds one to the value the mock is called with and returns it:" msgstr "" -":attr:`side_effect` se puede establecer en el constructor. Aquí hay un ejemplo " -"que suma uno al valor del objeto simulado llamado y lo retorna:" +":attr:`side_effect` se puede establecer en el constructor. Aquí hay un " +"ejemplo que suma uno al valor del objeto simulado llamado y lo retorna:" #: ../Doc/library/unittest.mock.rst:597 msgid "Setting :attr:`side_effect` to ``None`` clears it:" @@ -710,47 +722,49 @@ msgstr "Establecer :attr:`side_effect` en ``None`` lo desactiva:" #: ../Doc/library/unittest.mock.rst:611 msgid "" -"This is either ``None`` (if the mock hasn't been called), or the arguments that " -"the mock was last called with. This will be in the form of a tuple: the first " -"member, which can also be accessed through the ``args`` property, is any " -"ordered arguments the mock was called with (or an empty tuple) and the second " -"member, which can also be accessed through the ``kwargs`` property, is any " -"keyword arguments (or an empty dictionary)." +"This is either ``None`` (if the mock hasn't been called), or the arguments " +"that the mock was last called with. This will be in the form of a tuple: the " +"first member, which can also be accessed through the ``args`` property, is " +"any ordered arguments the mock was called with (or an empty tuple) and the " +"second member, which can also be accessed through the ``kwargs`` property, is " +"any keyword arguments (or an empty dictionary)." msgstr "" -"Este atributo es ``None`` (si el objetos simulado no ha sido llamado) o los " +"Este atributo es ``None`` (si el objeto simulado no ha sido llamado) o los " "argumentos con los que se llamó por última vez. En este último caso, será una " "tupla con dos elementos: el primer miembro, que también es accesible a través " -"de la propiedad ``args``, son los argumentos posicionales con los que el objeto " -"simulado se llamó (o una tupla vacía si no se pasó ninguno) y el segundo " -"miembro, que también es accesible mediante la propiedad ``kwargs``, es " -"cualquier argumento por palabra clave (o un diccionario vacío si no se pasó " -"ninguno)." +"de la propiedad ``args``, son los argumentos posicionales con los que el " +"objeto simulado se llamó (o una tupla vacía si no se pasó ninguno) y el " +"segundo miembro, que también es accesible mediante la propiedad ``kwargs``, " +"son los argumento por palabra clave pasados (o un diccionario vacío si no se " +"pasó ninguno)." #: ../Doc/library/unittest.mock.rst:644 msgid "" ":attr:`call_args`, along with members of the lists :attr:`call_args_list`, :" -"attr:`method_calls` and :attr:`mock_calls` are :data:`call` objects. These are " -"tuples, so they can be unpacked to get at the individual arguments and make " -"more complex assertions. See :ref:`calls as tuples `." +"attr:`method_calls` and :attr:`mock_calls` are :data:`call` objects. These " +"are tuples, so they can be unpacked to get at the individual arguments and " +"make more complex assertions. See :ref:`calls as tuples `." msgstr "" "El atributo :attr:`call_args`, junto con los miembros de las listas :attr:" "`call_args_list`, :attr:`method_calls` y :attr:`mock_calls` son objetos :data:" -"`call`. Estos son tuplas, con la finalidad de que puedan ser desempaquetadas " -"para acceder a los argumentos individuales y hacer aserciones más complejas. " -"Consultar :ref:`llamadas como tuplas ` para más información." +"`call`. Estos objetos son tuplas, con la finalidad de que puedan ser " +"desempaquetadas para acceder a los argumentos individuales y hacer aserciones " +"más complejas. Consultar :ref:`objetos call como tuplas ` " +"para más información." #: ../Doc/library/unittest.mock.rst:653 msgid "" "This is a list of all the calls made to the mock object in sequence (so the " -"length of the list is the number of times it has been called). Before any calls " -"have been made it is an empty list. The :data:`call` object can be used for " -"conveniently constructing lists of calls to compare with :attr:`call_args_list`." +"length of the list is the number of times it has been called). Before any " +"calls have been made it is an empty list. The :data:`call` object can be used " +"for conveniently constructing lists of calls to compare with :attr:" +"`call_args_list`." msgstr "" "Este argumento es una lista de todas las llamadas consecutivas realizadas al " "objeto simulado (por lo que la longitud de la lista es el número de veces que " "se ha llamado). Previamente a que se hayan realizado llamadas es una lista " -"vacía. El objeto :data:`call` se puede utilizar para construir convenientemente " -"las listas de llamadas a comparar con :attr:`call_args_list`." +"vacía. El objeto :data:`call` se puede utilizar para construir " +"convenientemente las listas de llamadas a comparar con :attr:`call_args_list`." #: ../Doc/library/unittest.mock.rst:669 msgid "" @@ -760,26 +774,28 @@ msgid "" msgstr "" "Los miembros de :attr:`call_args_list` son objetos :data:`call`. Estos pueden " "ser desempaquetados como tuplas para acceder a los argumentos individuales. " -"Consultar :ref:`llamadas como tuplas ` para más información." +"Consultar :ref:`objetos call como tuplas ` para más " +"información." #: ../Doc/library/unittest.mock.rst:676 msgid "" -"As well as tracking calls to themselves, mocks also track calls to methods and " -"attributes, and *their* methods and attributes:" +"As well as tracking calls to themselves, mocks also track calls to methods " +"and attributes, and *their* methods and attributes:" msgstr "" "Igual que realizan un seguimiento de las llamadas hechas a sí mismos, los " -"objetos simulados también realizan un seguimiento a *sus* métodos y atributos, " -"así como de las llamadas hechas a los mismos:" +"objetos simulados también realizan un seguimiento a *sus* métodos y " +"atributos, así como de las llamadas hechas a los mismos:" #: ../Doc/library/unittest.mock.rst:687 msgid "" -"Members of :attr:`method_calls` are :data:`call` objects. These can be unpacked " -"as tuples to get at the individual arguments. See :ref:`calls as tuples `." +"Members of :attr:`method_calls` are :data:`call` objects. These can be " +"unpacked as tuples to get at the individual arguments. See :ref:`calls as " +"tuples `." msgstr "" -"Los miembros de :attr:`method_calls` son objetos :data:`call`. Estos pueden ser " -"desempaquetados como tuplas para acceder a los atributos individuales. " -"Consultar :ref:`llamadas como tuplas ` para más información." +"Los miembros de :attr:`method_calls` son objetos :data:`call`. Estos pueden " +"ser desempaquetados como tuplas para acceder a los atributos individuales. " +"Consultar :ref:`objetos call como tuplas ` para más " +"información." #: ../Doc/library/unittest.mock.rst:694 msgid "" @@ -792,32 +808,33 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:712 msgid "" "Members of :attr:`mock_calls` are :data:`call` objects. These can be unpacked " -"as tuples to get at the individual arguments. See :ref:`calls as tuples `." +"as tuples to get at the individual arguments. See :ref:`calls as tuples " +"`." msgstr "" "Los miembros de :attr:`mock_calls` son objetos :data:`call`. Estos pueden ser " "desempaquetados como tuplas para acceder a los argumentos individuales. " -"Consultar :ref:`llamadas como tuplas ` para más información." +"Consultar :ref:`objetos call como tuplas ` para más " +"información." #: ../Doc/library/unittest.mock.rst:718 msgid "" -"The way :attr:`mock_calls` are recorded means that where nested calls are made, " -"the parameters of ancestor calls are not recorded and so will always compare " -"equal:" +"The way :attr:`mock_calls` are recorded means that where nested calls are " +"made, the parameters of ancestor calls are not recorded and so will always " +"compare equal:" msgstr "" -"La forma como se registra el atributo :attr:`mock_calls` implica que cuando se " -"realizan llamadas anidadas los parámetros de las llamadas previas no se " +"La forma como se registra el atributo :attr:`mock_calls` implica que cuando " +"se realizan llamadas anidadas, los parámetros de las llamadas previas no se " "registran, por lo que siempre resultan iguales al comparar:" #: ../Doc/library/unittest.mock.rst:732 msgid "" -"Normally the :attr:`__class__` attribute of an object will return its type. For " -"a mock object with a :attr:`spec`, ``__class__`` returns the spec class " +"Normally the :attr:`__class__` attribute of an object will return its type. " +"For a mock object with a :attr:`spec`, ``__class__`` returns the spec class " "instead. This allows mock objects to pass :func:`isinstance` tests for the " "object they are replacing / masquerading as:" msgstr "" -"Normalmente el atributo de un objeto :attr:`__class__` retornará su tipo. Para " -"un objeto simulado con un :attr:`spec`, ``__class__`` retorna la clase " +"Normalmente, el atributo de un objeto :attr:`__class__` retornará su tipo. " +"Para un objeto simulado con un :attr:`spec`, ``__class__`` retorna la clase " "especificada en su lugar. Esto permite a los objetos simulados pasar los test " "de :func:`isinstance` para el objeto que están reemplazando / enmascarando:" @@ -826,9 +843,9 @@ msgid "" ":attr:`__class__` is assignable to, this allows a mock to pass an :func:" "`isinstance` check without forcing you to use a spec:" msgstr "" -"El atributo :attr:`__class__` es asignable al mismo, esto permite al objeto " -"simulado pasar una verificación de :func:`isinstance` sin verse forzado a " -"utilizar una especificación:" +"El atributo :attr:`__class__` es asignable, esto permite al objeto simulado " +"pasar una verificación de :func:`isinstance` sin verse forzado a utilizar una " +"especificación:" #: ../Doc/library/unittest.mock.rst:751 msgid "" @@ -855,16 +872,17 @@ msgid "" "`magic methods ` for the full details." msgstr "" "Las clases :class:`Mock` tienen soporte para simular los métodos mágicos. " -"Consultar los :ref:`métodos mágicos ` para ver los detalles." +"Consultar la sección dedicada a los :ref:`métodos mágicos ` " +"para ver los detalles." #: ../Doc/library/unittest.mock.rst:768 msgid "" "The mock classes and the :func:`patch` decorators all take arbitrary keyword " -"arguments for configuration. For the :func:`patch` decorators the keywords are " -"passed to the constructor of the mock being created. The keyword arguments are " -"for configuring attributes of the mock:" +"arguments for configuration. For the :func:`patch` decorators the keywords " +"are passed to the constructor of the mock being created. The keyword " +"arguments are for configuring attributes of the mock:" msgstr "" -"Las clases simuladas y los decoradores :func:`patch` aceptan todos argumentos " +"Las clases simuladas y los decoradores :func:`patch` aceptan todas argumentos " "por palabra clave arbitrarios para la configuración. En los decoradores :func:" "`patch` los argumentos por palabra clave se pasan al constructor del objeto " "simulado creado. Estos argumentos se usan para configurar los atributos del " @@ -876,9 +894,11 @@ msgid "" "using dotted notation. As you can't use dotted names directly in a call you " "have to create a dictionary and unpack it using ``**``:" msgstr "" -"Tanto el valor de retorno como el efecto colateral del objeto simulado. Dado " -"que no se puede utilizar notación de punto directamente en una llamada, se " -"tiene que crear un diccionario y desempaquetarlo usando ``**``:" +"Tanto el valor de retorno como el efecto colateral del objeto simulado pueden " +"ser establecidos de la misma manera, mediante notación de punto. En cambio, " +"si se quieren establecer mediante el constructor, dado que no se puede " +"utilizar notación de punto directamente en una llamada, se tiene que crear un " +"diccionario y desempaquetarlo usando ``**``:" #: ../Doc/library/unittest.mock.rst:794 msgid "" @@ -889,9 +909,9 @@ msgid "" msgstr "" "Un objeto simulado invocable que fue creado con un *spec* (o un *spec_set*) " "introspeccionará la firma del objeto de la especificación en el momento de " -"emparejar las llamadas al objeto simulado. Esto le permite hacer coincidir sus " -"argumentos con los argumentos de la llamada real, independientemente de si se " -"pasaron por posición o por por nombre:" +"emparejar las llamadas al objeto simulado. Esto le permite hacer coincidir " +"sus argumentos con los argumentos de la llamada real, independientemente de " +"si se pasaron por posición o por nombre:" #: ../Doc/library/unittest.mock.rst:807 msgid "" @@ -902,8 +922,8 @@ msgid "" msgstr "" "Esto se aplica a :meth:`~Mock.assert_called_with`, :meth:`~Mock." "assert_called_once_with`, :meth:`~Mock.assert_has_calls` y :meth:`~Mock." -"assert_any_call`. Cuando se especifica :ref:`auto-speccing`, también se " -"aplicará a las llamadas de los métodos del objeto simulado." +"assert_any_call`. Cuando se hace uso de :ref:`auto-speccing`, también se " +"aplicará a las llamadas a los métodos del objeto simulado." #: ../Doc/library/unittest.mock.rst:812 msgid "Added signature introspection on specced and autospecced mock objects." @@ -917,10 +937,10 @@ msgid "" "class:`PropertyMock` provides :meth:`__get__` and :meth:`__set__` methods so " "you can specify a return value when it is fetched." msgstr "" -"Un objeto simulado destinado a ser utilizado en una clase como una propiedad, u " -"otro descriptor. La clase :class:`PropertyMock` proporciona los métodos :meth:" -"`__get__` y :meth:`__set__`, por lo que puedes especificar un valor de retorno " -"para cuando su valor es requerido." +"Un objeto simulado destinado a ser utilizado en una clase como una propiedad, " +"u otro descriptor. La clase :class:`PropertyMock` proporciona los métodos :" +"meth:`__get__` y :meth:`__set__`, por lo que puedes especificar un valor de " +"retorno para cuando su valor es requerido." #: ../Doc/library/unittest.mock.rst:822 msgid "" @@ -929,7 +949,7 @@ msgid "" msgstr "" "La obtención de una instancia desde un objeto :class:`PropertyMock` ocasiona " "una llamada al objeto simulado, sin argumentos. Establecer su valor también " -"llama al objeto simulado, con el valor a establecer como argumento. ::" +"llama al objeto simulado, con el valor a establecer como argumento." #: ../Doc/library/unittest.mock.rst:843 msgid "" @@ -948,8 +968,8 @@ msgid "" "call is an awaitable." msgstr "" "Una versión asíncrona de :class:`Mock`. El objeto :class:`AsyncMock` se " -"comportará de tal modo que el objeto es reconocido como una función asíncrona y " -"el resultado de su llamada es un objeto 'esperable' (awaitable)." +"comportará de tal modo que el objeto es reconocido como una función asíncrona " +"y el resultado de su llamada es un objeto 'esperable' (awaitable)." #: ../Doc/library/unittest.mock.rst:867 msgid "" @@ -958,21 +978,23 @@ msgid "" msgstr "" "El resultado de ``mock()`` es una función asíncrona que proporcionará el " "resultado de ``side_effect`` o de ``return_value`` después de haber sido " -"\"esperada\" (awaited):" +"'esperada':" #: ../Doc/library/unittest.mock.rst:870 msgid "" -"if ``side_effect`` is a function, the async function will return the result of " -"that function," +"if ``side_effect`` is a function, the async function will return the result " +"of that function," msgstr "" -"si ``side_effect`` es una función, la función asíncrona retornará el resultado " -"de esa función," +"si ``side_effect`` es una función, la función asíncrona retornará el " +"resultado de esa función," #: ../Doc/library/unittest.mock.rst:872 msgid "" -"if ``side_effect`` is an exception, the async function will raise the exception," +"if ``side_effect`` is an exception, the async function will raise the " +"exception," msgstr "" -"si ``side_effect`` es una excepción, la función asíncrona lanza la excepción," +"si ``side_effect`` es una excepción, la función asíncrona lanzará la " +"excepción," #: ../Doc/library/unittest.mock.rst:874 msgid "" @@ -980,9 +1002,9 @@ msgid "" "value of the iterable, however, if the sequence of result is exhausted, " "``StopAsyncIteration`` is raised immediately," msgstr "" -"si ``side_effect`` es un iterable, la función asíncrona retornará el siguiente " -"valor del iterable, sin embargo, si se agota la secuencia de resultados, se " -"lanza una excepción ``StopAsyncIteration`` inmediatamente," +"si ``side_effect`` es un iterable, la función asíncrona retornará el " +"siguiente valor del iterable, sin embargo, si se agota la secuencia de " +"resultados, se lanza una excepción ``StopAsyncIteration`` inmediatamente," #: ../Doc/library/unittest.mock.rst:877 msgid "" @@ -999,9 +1021,9 @@ msgid "" "Setting the *spec* of a :class:`Mock` or :class:`MagicMock` to an async " "function will result in a coroutine object being returned after calling." msgstr "" -"Establecer el argumento *spec* de un objeto :class:`Mock` o :class:`MagicMock` " -"en una función asíncrona resultará en que un objeto corrutina será retornado " -"después de la llamada." +"Establecer el argumento *spec* de un objeto :class:`Mock` o :class:" +"`MagicMock` en una función asíncrona resultará en que un objeto corrutina " +"será retornado después de la llamada al objeto." #: ../Doc/library/unittest.mock.rst:894 msgid "" @@ -1016,58 +1038,59 @@ msgstr "" "o :class:`AsyncMock` en una clase que tiene simultáneamente funciones " "asíncronas y síncronas hará que se detecten automáticamente las funciones " "sincrónicas y las establecerá como :class:`MagicMock` (si el objeto simulado " -"padre es :class:`AsyncMock` o :class:`MagicMock`) o :class:`Mock` (si el objeto " -"simulado padre es :class:`Mock`) . Todas las funciones asíncronas serán :class:" -"`AsyncMock`." +"padre es :class:`AsyncMock` o :class:`MagicMock`) o :class:`Mock` (si el " +"objeto simulado padre es :class:`Mock`) . Todas las funciones asíncronas " +"serán :class:`AsyncMock`." #: ../Doc/library/unittest.mock.rst:922 msgid "" -"Assert that the mock was awaited at least once. Note that this is separate from " -"the object having been called, the ``await`` keyword must be used:" +"Assert that the mock was awaited at least once. Note that this is separate " +"from the object having been called, the ``await`` keyword must be used:" msgstr "" -"Aserta si el objeto simulado fue \"esperado\" (awaited) al menos una vez. Ten " -"en cuenta que independientemente del objeto que ha sido llamado, la palabra " -"clave ``await`` debe ser utilizada:" +"Aserta si el objeto simulado fue 'esperado' al menos una vez. Ten en cuenta " +"que, independientemente del objeto que ha sido llamado, la palabra clave " +"``await`` debe ser utilizada:" #: ../Doc/library/unittest.mock.rst:941 msgid "Assert that the mock was awaited exactly once." -msgstr "" -"Aserta si que el objeto simulado fue 'esperado' (awaited) exactamente una vez." +msgstr "Aserta si que el objeto simulado fue 'esperado' exactamente una vez." #: ../Doc/library/unittest.mock.rst:957 msgid "Assert that the last await was with the specified arguments." -msgstr "Aserta si la última 'espera' fue con los argumentos especificados." +msgstr "" +"Aserta si la última 'espera' (await) fue con los argumentos especificados." #: ../Doc/library/unittest.mock.rst:974 msgid "" -"Assert that the mock was awaited exactly once and with the specified arguments." +"Assert that the mock was awaited exactly once and with the specified " +"arguments." msgstr "" -"Aserta si que el objeto simulado se ha \"esperado\" (awaited) exactamente una " -"vez y con los argumentos especificados." +"Aserta si que el objeto simulado se ha 'esperado' exactamente una vez y con " +"los argumentos especificados." #: ../Doc/library/unittest.mock.rst:991 msgid "Assert the mock has ever been awaited with the specified arguments." msgstr "" -"Aserta si el objeto simulado nunca se ha \"esperado\" (awaited) con los " -"argumentos especificados." +"Aserta si el objeto simulado nunca se ha 'esperado' con los argumentos " +"especificados." #: ../Doc/library/unittest.mock.rst:1007 msgid "" "Assert the mock has been awaited with the specified calls. The :attr:" "`await_args_list` list is checked for the awaits." msgstr "" -"Aserta si el objeto simulado ha sido 'esperado' (awaited) con las llamadas " -"especificadas. La lista :attr:`await_args_list` es comprobada por las " -"'esperas' (awaits)." +"Aserta si el objeto simulado ha sido 'esperado' con las llamadas " +"especificadas. Para comprobar las 'esperas' (awaits) se utiliza la lista :" +"attr:`await_args_list`." #: ../Doc/library/unittest.mock.rst:1010 msgid "" -"If *any_order* is false then the awaits must be sequential. There can be extra " -"calls before or after the specified awaits." +"If *any_order* is false then the awaits must be sequential. There can be " +"extra calls before or after the specified awaits." msgstr "" -"Si *any_order* es falso entonces las 'esperas' (awaits) deben ser secuenciales. " -"No puede haber llamadas adicionales antes o después de las 'esperas' (awaits) " -"especificados." +"Si *any_order* es falso, las 'esperas' (awaits) deben ser secuenciales. No " +"puede haber llamadas adicionales antes o después de las 'esperas' " +"especificadas." #: ../Doc/library/unittest.mock.rst:1014 msgid "" @@ -1075,26 +1098,25 @@ msgid "" "appear in :attr:`await_args_list`." msgstr "" "Si *any_order* es verdadero, entonces las 'esperas' (awaits) pueden estar en " -"cualquier orden, pero deben aparecer todos en :attr:`await_args_list`." +"cualquier orden, pero deben aparecer todas en :attr:`await_args_list`." #: ../Doc/library/unittest.mock.rst:1034 msgid "Assert that the mock was never awaited." -msgstr "Aserta si el objeto simulado nunca ha sido 'esperado' (awaited)." +msgstr "Aserta si el objeto simulado nunca ha sido 'esperado'." #: ../Doc/library/unittest.mock.rst:1041 msgid "" "See :func:`Mock.reset_mock`. Also sets :attr:`await_count` to 0, :attr:" "`await_args` to None, and clears the :attr:`await_args_list`." msgstr "" -"Consultar :func:`Mock.reset_mock` para más detalles. También establece :attr:" +"Consultar :func:`Mock.reset_mock`. Además, también establece :attr:" "`await_count` a 0, :attr:`await_args` a None y borra :attr:`await_args_list`." #: ../Doc/library/unittest.mock.rst:1046 msgid "" "An integer keeping track of how many times the mock object has been awaited." msgstr "" -"Un registro entero de cuántas veces se ha 'esperado' (awaited) el objeto de " -"simulado." +"Un registro entero de cuántas veces se ha 'esperado' el objeto simulado." #: ../Doc/library/unittest.mock.rst:1061 msgid "" @@ -1104,7 +1126,7 @@ msgid "" msgstr "" "Este atributo es ``None`` (si el objeto simulado no se ha 'esperado') o los " "argumentos con los que fue 'esperado' la última vez. Su funcionamiento es " -"idéntico que el de :attr:`Mock.call_args`." +"idéntico al de :attr:`Mock.call_args`." #: ../Doc/library/unittest.mock.rst:1079 msgid "" @@ -1114,8 +1136,8 @@ msgid "" msgstr "" "Es una lista de todas las 'esperas' (awaits) realizadas en el objeto simulado " "de forma secuencial (por lo que la longitud de la lista es el número de veces " -"que se ha 'esperado'). Si no se han realizado 'esperas' (awaits) previas es una " -"lista vacía." +"que se ha 'esperado' el objeto). Si no se han realizado 'esperas' previas es " +"una lista vacía." #: ../Doc/library/unittest.mock.rst:1098 msgid "Calling" @@ -1124,15 +1146,17 @@ msgstr "Llamar a los objetos simulados" #: ../Doc/library/unittest.mock.rst:1100 msgid "" "Mock objects are callable. The call will return the value set as the :attr:" -"`~Mock.return_value` attribute. The default return value is a new Mock object; " -"it is created the first time the return value is accessed (either explicitly or " -"by calling the Mock) - but it is stored and the same one returned each time." +"`~Mock.return_value` attribute. The default return value is a new Mock " +"object; it is created the first time the return value is accessed (either " +"explicitly or by calling the Mock) - but it is stored and the same one " +"returned each time." msgstr "" "Los objetos Mock son invocables. La llamada a uno retornará el valor " -"establecido en el atributo :attr:`~Mock.return_value`. El valor de retorno por " -"defecto es un nuevo objeto Mock, el cual se crea la primera vez que se accede " -"al valor de retorno (ya sea explícitamente o llamando al objeto Mock). Una vez " -"creado, se almacena y el mismo objeto es retornado cada vez que se solicita." +"establecido en el atributo :attr:`~Mock.return_value`. El valor de retorno " +"por defecto es un nuevo objeto Mock, el cual se crea la primera vez que se " +"accede al valor de retorno (ya sea explícitamente o llamando al objeto Mock). " +"Una vez creado, se almacena y el mismo objeto es retornado cada vez que se " +"solicita." #: ../Doc/library/unittest.mock.rst:1106 msgid "" @@ -1145,8 +1169,8 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:1109 msgid "" "If :attr:`~Mock.side_effect` is set then it will be called after the call has " -"been recorded, so if :attr:`side_effect` raises an exception the call is still " -"recorded." +"been recorded, so if :attr:`side_effect` raises an exception the call is " +"still recorded." msgstr "" "Si :attr:`~Mock.side_effect` se establece, será llamado después de que la " "llamada haya sido registrada, por lo que la llamada se registra aunque :attr:" @@ -1154,56 +1178,56 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:1113 msgid "" -"The simplest way to make a mock raise an exception when called is to make :attr:" -"`~Mock.side_effect` an exception class or instance:" +"The simplest way to make a mock raise an exception when called is to make :" +"attr:`~Mock.side_effect` an exception class or instance:" msgstr "" -"La forma más sencilla de hacer un objeto simulado lance de una excepción cuando " -"sea llamado es establecer su atributo :attr:`~Mock.side_effect` como una clase " -"o instancia de excepción:" +"La forma más sencilla de hacer un objeto simulado lance de una excepción " +"cuando sea llamado es establecer su atributo :attr:`~Mock.side_effect` como " +"una clase o instancia de excepción:" #: ../Doc/library/unittest.mock.rst:1131 msgid "" "If :attr:`side_effect` is a function then whatever that function returns is " -"what calls to the mock return. The :attr:`side_effect` function is called with " -"the same arguments as the mock. This allows you to vary the return value of the " -"call dynamically, based on the input:" +"what calls to the mock return. The :attr:`side_effect` function is called " +"with the same arguments as the mock. This allows you to vary the return value " +"of the call dynamically, based on the input:" msgstr "" -"Si :attr:`side_effect` es una función, la llamada al objeto simulado retornará " -"lo sea que esta función retorne. La función estableceida en :attr:`side_effect` " -"se llama con los mismos argumentos con los que el objeto simulado ha sido " -"llamado. Esto te permite variar el valor de retorno de la llamada " -"dinámicamente, en función de la entrada:" +"Si :attr:`side_effect` es una función, la llamada al objeto simulado " +"retornará lo que sea que esta función retorne. La función establecida en :" +"attr:`side_effect` se llama con los mismos argumentos con los que el objeto " +"simulado ha sido llamado. Esto te permite variar el valor de retorno de la " +"llamada dinámicamente, en función de la entrada:" #: ../Doc/library/unittest.mock.rst:1147 msgid "" -"If you want the mock to still return the default return value (a new mock), or " -"any set return value, then there are two ways of doing this. Either return :" -"attr:`mock.return_value` from inside :attr:`side_effect`, or return :data:" -"`DEFAULT`:" +"If you want the mock to still return the default return value (a new mock), " +"or any set return value, then there are two ways of doing this. Either " +"return :attr:`mock.return_value` from inside :attr:`side_effect`, or return :" +"data:`DEFAULT`:" msgstr "" "Si se desea que el objeto simulado aún retorne el valor por defecto (un nuevo " "objeto simulado), o cualquier valor de retorno establecido, entonces existen " "dos maneras de proceder. Se puede retornar tanto el atributo :attr:`mock." -"return_value` desde :attr:`side_effect` , como :data:`DEFAULT`:" +"return_value` como :data:`DEFAULT` desde :attr:`side_effect`:" #: ../Doc/library/unittest.mock.rst:1166 msgid "" -"To remove a :attr:`side_effect`, and return to the default behaviour, set the :" -"attr:`side_effect` to ``None``:" +"To remove a :attr:`side_effect`, and return to the default behaviour, set " +"the :attr:`side_effect` to ``None``:" msgstr "" "Para eliminar un :attr:`side_effect`, volviendo al comportamiento " "predeterminado, establece el atributo :attr:`side_effect` en ``None``:" #: ../Doc/library/unittest.mock.rst:1180 msgid "" -"The :attr:`side_effect` can also be any iterable object. Repeated calls to the " -"mock will return values from the iterable (until the iterable is exhausted and " -"a :exc:`StopIteration` is raised):" +"The :attr:`side_effect` can also be any iterable object. Repeated calls to " +"the mock will return values from the iterable (until the iterable is " +"exhausted and a :exc:`StopIteration` is raised):" msgstr "" -"El atributo :attr:`side_effect` también puede ser cualquier objeto iterable. En " -"este caso, las llamadas repetidas al objeto simulado irán retornando valores " -"del iterable (hasta que el iterable se agote, momento en el que se lanza una " -"excepción :exc:`StopIteration`):" +"El atributo :attr:`side_effect` también puede ser cualquier objeto iterable. " +"En este caso, las llamadas repetidas al objeto simulado irán retornando " +"valores del iterable (hasta que el iterable se agote, momento en el que se " +"lanza una excepción :exc:`StopIteration`):" #: ../Doc/library/unittest.mock.rst:1196 msgid "" @@ -1215,21 +1239,21 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:1214 msgid "Deleting Attributes" -msgstr "La eliminación de atributos" +msgstr "Eliminar atributos" #: ../Doc/library/unittest.mock.rst:1216 msgid "" "Mock objects create attributes on demand. This allows them to pretend to be " "objects of any type." msgstr "" -"Los objetos simulados crear atributos en demanda. Esto les permite pasarse por " -"objetos de cualquier tipo." +"Los objetos simulados crean atributos en demanda. Esto les permite hacerse " +"pasar por objetos de cualquier tipo." #: ../Doc/library/unittest.mock.rst:1219 msgid "" "You may want a mock object to return ``False`` to a :func:`hasattr` call, or " -"raise an :exc:`AttributeError` when an attribute is fetched. You can do this by " -"providing an object as a :attr:`spec` for a mock, but that isn't always " +"raise an :exc:`AttributeError` when an attribute is fetched. You can do this " +"by providing an object as a :attr:`spec` for a mock, but that isn't always " "convenient." msgstr "" "Es posible que desees que un objeto simulado retorne ``False`` al llamar a :" @@ -1240,15 +1264,15 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:1223 msgid "" -"You \"block\" attributes by deleting them. Once deleted, accessing an attribute " -"will raise an :exc:`AttributeError`." +"You \"block\" attributes by deleting them. Once deleted, accessing an " +"attribute will raise an :exc:`AttributeError`." msgstr "" -"Puedes \"bloquear\" atributos eliminándolos. Una vez eliminado, el acceso a un " -"atributo lanzará una excepción :exc:`AttributeError`." +"Puedes \"bloquear\" atributos eliminándolos. Una vez eliminado, el acceso a " +"un atributo lanzará una excepción :exc:`AttributeError`." #: ../Doc/library/unittest.mock.rst:1240 msgid "Mock names and the name attribute" -msgstr "Los nombres de los objetos simulados y el atributo nombre" +msgstr "Los nombres de los objetos simulados y el atributo *name*" #: ../Doc/library/unittest.mock.rst:1242 msgid "" @@ -1258,16 +1282,16 @@ msgid "" "configure_mock`::" msgstr "" "Dado que \"name\" es un argumento para el constructor de la clase :class:" -"`Mock`, si quieres que tu objeto simulado tenga un atributo \"name\", no puedes " -"simplemente pasarlo al constructor en tiempo de creación. Hay dos alternativas. " -"Una opción es usar el método :meth:`~Mock.configure_mock`:" +"`Mock`, si quieres que tu objeto simulado tenga un atributo \"name\", no " +"puedes simplemente pasarlo al constructor en tiempo de creación. Hay dos " +"alternativas. Una opción es usar el método :meth:`~Mock.configure_mock`:" #: ../Doc/library/unittest.mock.rst:1252 msgid "" "A simpler option is to simply set the \"name\" attribute after mock creation::" msgstr "" -"Una opción más sencilla es simplemente establecer el atributo \"name\" después " -"de la creación del objeto simulado:" +"Una opción más sencilla es simplemente establecer el atributo \"name\" " +"después de la creación del objeto simulado:" #: ../Doc/library/unittest.mock.rst:1259 msgid "Attaching Mocks as Attributes" @@ -1275,13 +1299,13 @@ msgstr "Adjuntar objetos simulados como atributos" #: ../Doc/library/unittest.mock.rst:1261 msgid "" -"When you attach a mock as an attribute of another mock (or as the return value) " -"it becomes a \"child\" of that mock. Calls to the child are recorded in the :" -"attr:`~Mock.method_calls` and :attr:`~Mock.mock_calls` attributes of the " -"parent. This is useful for configuring child mocks and then attaching them to " -"the parent, or for attaching mocks to a parent that records all calls to the " -"children and allows you to make assertions about the order of calls between " -"mocks:" +"When you attach a mock as an attribute of another mock (or as the return " +"value) it becomes a \"child\" of that mock. Calls to the child are recorded " +"in the :attr:`~Mock.method_calls` and :attr:`~Mock.mock_calls` attributes of " +"the parent. This is useful for configuring child mocks and then attaching " +"them to the parent, or for attaching mocks to a parent that records all calls " +"to the children and allows you to make assertions about the order of calls " +"between mocks:" msgstr "" "Cuando se adjunta un objeto simulado como un atributo de otro objeto simulado " "(o como su valor de retorno) se convierte en un \"hijo\" del mismo. Las " @@ -1294,17 +1318,18 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:1279 msgid "" -"The exception to this is if the mock has a name. This allows you to prevent the " -"\"parenting\" if for some reason you don't want it to happen." +"The exception to this is if the mock has a name. This allows you to prevent " +"the \"parenting\" if for some reason you don't want it to happen." msgstr "" -"La excepción es si el objeto simulado tiene un nombre. Esto te permite evitar " -"el comportamiento de \"parentesco\" explicado si por alguna razón no deseas que " -"suceda." +"La excepción a lo anterior es si el objeto simulado tiene un nombre. Esto te " +"permite evitar el comportamiento de \"parentesco\" explicado previamente, si " +"por alguna razón no deseas que suceda." #: ../Doc/library/unittest.mock.rst:1290 msgid "" -"Mocks created for you by :func:`patch` are automatically given names. To attach " -"mocks that have names to a parent you use the :meth:`~Mock.attach_mock` method::" +"Mocks created for you by :func:`patch` are automatically given names. To " +"attach mocks that have names to a parent you use the :meth:`~Mock." +"attach_mock` method::" msgstr "" "Los objetos simulados creados automáticamente por la función :func:`patch` " "también reciben nombres automáticamente. Para adjuntar un objeto simulado con " @@ -1313,19 +1338,19 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:1308 msgid "" "The only exceptions are magic methods and attributes (those that have leading " -"and trailing double underscores). Mock doesn't create these but instead raises " -"an :exc:`AttributeError`. This is because the interpreter will often implicitly " -"request these methods, and gets *very* confused to get a new Mock object when " -"it expects a magic method. If you need magic method support see :ref:`magic " -"methods `." -msgstr "" -"Las únicas excepciones son los métodos y atributos mágicos (aquellos que tienen " -"doble subrayado al principio y al final). Mock no los crea automáticamente, " -"sino que lanza una excepción :exc:`AttributeError`. Esto se debe a que el " -"intérprete a menudo solicitará implícitamente estos métodos y terminaría *muy* " -"confundido si obtiene un nuevo objeto Mock cuando espera un método mágico. Si " -"necesitas soporte para métodos mágicos, consulta :ref:`métodos mágicos `." +"and trailing double underscores). Mock doesn't create these but instead " +"raises an :exc:`AttributeError`. This is because the interpreter will often " +"implicitly request these methods, and gets *very* confused to get a new Mock " +"object when it expects a magic method. If you need magic method support see :" +"ref:`magic methods `." +msgstr "" +"Las únicas excepciones son los métodos y atributos mágicos (aquellos que " +"tienen doble subrayado al principio y al final). Mock no los crea " +"automáticamente, sino que lanza una excepción :exc:`AttributeError`. Esto se " +"debe a que el intérprete a menudo solicitará implícitamente estos métodos y " +"terminaría *muy* confundido si obtiene un nuevo objeto Mock cuando espera un " +"método mágico. Si necesitas soporte para métodos mágicos, consulta :ref:" +"`métodos mágicos `." #: ../Doc/library/unittest.mock.rst:1317 msgid "The patchers" @@ -1333,15 +1358,16 @@ msgstr "Parcheadores" #: ../Doc/library/unittest.mock.rst:1319 msgid "" -"The patch decorators are used for patching objects only within the scope of the " -"function they decorate. They automatically handle the unpatching for you, even " -"if exceptions are raised. All of these functions can also be used in with " -"statements or as class decorators." +"The patch decorators are used for patching objects only within the scope of " +"the function they decorate. They automatically handle the unpatching for you, " +"even if exceptions are raised. All of these functions can also be used in " +"with statements or as class decorators." msgstr "" "Los decoradores path se utilizan para parchear los objetos sólo dentro del " -"ámbito de la función que decoran. Se encargan automáticamente de desparchear, " -"incluso si se lanzan excepciones. Todas estas funciones también se pueden " -"utilizar con declaraciones o como decoradores de clase." +"ámbito de la función que decoran. Se encargan automáticamente de desparchear " +"una vez terminada la prueba, incluso si se lanzan excepciones. Todas estas " +"funciones también se pueden utilizar con declaraciones o como decoradores de " +"clase." #: ../Doc/library/unittest.mock.rst:1326 msgid "patch" @@ -1364,26 +1390,27 @@ msgid "" "is undone." msgstr "" ":func:`patch` actúa como decorador de función, decorador de clase o como " -"administrador de contexto. Ya sea en el interior del cuerpo de una función o " -"dentro de una declaración with, *target* es parcheado con un objeto *new*. " -"Cuando la función / declaración with termina su ejecución el parche se deshace " +"gestor de contexto. Ya sea en el interior del cuerpo de una función o dentro " +"de una declaración with, *target* es parcheado con un objeto *new*. Cuando la " +"función / declaración with termina su ejecución el parche se deshace " "automáticamente." #: ../Doc/library/unittest.mock.rst:1340 msgid "" -"If *new* is omitted, then the target is replaced with an :class:`AsyncMock` if " -"the patched object is an async function or a :class:`MagicMock` otherwise. If :" -"func:`patch` is used as a decorator and *new* is omitted, the created mock is " -"passed in as an extra argument to the decorated function. If :func:`patch` is " -"used as a context manager the created mock is returned by the context manager." +"If *new* is omitted, then the target is replaced with an :class:`AsyncMock` " +"if the patched object is an async function or a :class:`MagicMock` otherwise. " +"If :func:`patch` is used as a decorator and *new* is omitted, the created " +"mock is passed in as an extra argument to the decorated function. If :func:" +"`patch` is used as a context manager the created mock is returned by the " +"context manager." msgstr "" -"Si se omite *new*, entonces el objetivo se reemplaza con un objeto :class:" +"Si se omite *new*, entonces el objetivo se reemplaza por un objeto :class:" "`AsyncMock` si el objeto parcheado es una función asíncrona, o con un objeto :" -"class:`MagicMock` en caso contrario. Si se utiliza :func:`patch` como decorador " -"y se omite *new*, el objeto simulado creado se pasa como un argumento adicional " -"a la función decorada. Si se utiliza :func:`patch` como un administrador de " -"contexto, el objeto simulado creado es retornado por el administrador de " -"contexto." +"class:`MagicMock` en caso contrario. Si se utiliza :func:`patch` como " +"decorador y se omite *new*, el objeto simulado creado se pasa como un " +"argumento adicional a la función decorada. Si se utiliza :func:`patch` como " +"un gestor de contexto, el objeto simulado creado es retornado por el gestor " +"de contexto." #: ../Doc/library/unittest.mock.rst:1348 msgid "" @@ -1393,11 +1420,12 @@ msgid "" "`patch` from. The target is imported when the decorated function is executed, " "not at decoration time." msgstr "" -"*target* debe ser una cadena de la forma ``'paquete.modulo.NombreDeLaClase'``. " -"*target* es importado y el objeto especificado reemplazado con el objeto *new*, " -"por lo que *target* debe ser importable desde el entorno desde el cual estás " -"llamando a :func:`patch`. Hay que tener presente que *target* es importado " -"cuando se ejecuta la función decorada, no en tiempo de decoración." +"*target* debe ser una cadena de la forma ``'paquete.modulo." +"NombreDeLaClase'``. *target* es importado y el objeto especificado " +"reemplazado por el objeto *new*, por lo que *target* debe ser importable " +"desde el entorno desde el cual estás llamando a :func:`patch`. Hay que tener " +"presente que *target* es importado cuando se ejecuta la función decorada, no " +"en tiempo de decoración." #: ../Doc/library/unittest.mock.rst:1354 msgid "" @@ -1409,8 +1437,8 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:1357 msgid "" -"In addition you can pass ``spec=True`` or ``spec_set=True``, which causes patch " -"to pass in the object being mocked as the spec/spec_set object." +"In addition you can pass ``spec=True`` or ``spec_set=True``, which causes " +"patch to pass in the object being mocked as the spec/spec_set object." msgstr "" "Además, puedes pasar ``spec=True`` o ``spec_set=True``, lo que causa que path " "pase el objeto que está siendo simulado como el objeto spec/spec_set." @@ -1422,19 +1450,19 @@ msgid "" "is used for async functions and :class:`MagicMock` for the rest." msgstr "" "*new_callable* te permite especificar una clase diferente, o un objeto " -"invocable, que será llamada para crear el objeto *new*. Por defecto se utiliza :" -"class:`AsyncMock` para las funciones asíncronas y :class:`MagicMock` para el " -"resto." +"invocable, que será llamada para crear el objeto *new*. Por defecto se " +"utiliza :class:`AsyncMock` para las funciones asíncronas y :class:`MagicMock` " +"para el resto." #: ../Doc/library/unittest.mock.rst:1364 msgid "" -"A more powerful form of *spec* is *autospec*. If you set ``autospec=True`` then " -"the mock will be created with a spec from the object being replaced. All " +"A more powerful form of *spec* is *autospec*. If you set ``autospec=True`` " +"then the mock will be created with a spec from the object being replaced. All " "attributes of the mock will also have the spec of the corresponding attribute " "of the object being replaced. Methods and functions being mocked will have " "their arguments checked and will raise a :exc:`TypeError` if they are called " -"with the wrong signature. For mocks replacing a class, their return value (the " -"'instance') will have the same spec as the class. See the :func:" +"with the wrong signature. For mocks replacing a class, their return value " +"(the 'instance') will have the same spec as the class. See the :func:" "`create_autospec` function and :ref:`auto-speccing`." msgstr "" "Una variante más poderosa de *spec* es *autospec*. Si estableces " @@ -1442,38 +1470,38 @@ msgstr "" "objeto que está siendo reemplazado. Todos los atributos del objeto simulado " "también tendrán la especificación del atributo correspondiente del objeto que " "está siendo reemplazado. Los argumentos de los métodos y funciones simulados " -"son comprobados y se lanzará una excepción :exc:`TypeError` si se les llama con " -"la firma incorrecta. Para los objetos simulados que sustituyen a una clase, su " -"valor de retorno (la 'instancia') tendrá la misma especificación que la clase. " -"Consultar las funciones :func:`create_autospec` y :ref:`auto-speccing` para más " -"detalles." +"son comprobados y se lanzará una excepción :exc:`TypeError` si se les llama " +"con la firma incorrecta. Para los objetos simulados que sustituyen a una " +"clase, su valor de retorno (la 'instancia') tendrá la misma especificación " +"que la clase. Consultar la función :func:`create_autospec` y :ref:`auto-" +"speccing` para más detalles." #: ../Doc/library/unittest.mock.rst:1374 msgid "" "Instead of ``autospec=True`` you can pass ``autospec=some_object`` to use an " "arbitrary object as the spec instead of the one being replaced." msgstr "" -"En lugar de ``autospec=True`` puedes pasar ``autospec=some_object`` para " +"En lugar de ``autospec=True``, puedes pasar ``autospec=some_object`` para " "utilizar un objeto arbitrario como especificación en lugar del objeto " "reemplazado." #: ../Doc/library/unittest.mock.rst:1377 msgid "" "By default :func:`patch` will fail to replace attributes that don't exist. If " -"you pass in ``create=True``, and the attribute doesn't exist, patch will create " -"the attribute for you when the patched function is called, and delete it again " -"after the patched function has exited. This is useful for writing tests against " -"attributes that your production code creates at runtime. It is off by default " -"because it can be dangerous. With it switched on you can write passing tests " -"against APIs that don't actually exist!" -msgstr "" -"Por defecto :func:`patch` fallará al intentar reemplazar atributos que no " +"you pass in ``create=True``, and the attribute doesn't exist, patch will " +"create the attribute for you when the patched function is called, and delete " +"it again after the patched function has exited. This is useful for writing " +"tests against attributes that your production code creates at runtime. It is " +"off by default because it can be dangerous. With it switched on you can write " +"passing tests against APIs that don't actually exist!" +msgstr "" +"Por defecto, :func:`patch` fallará al intentar reemplazar atributos que no " "existen. Si pasas ``create=True`` y no existe el atributo, patch crea el " -"atributo cuando la función se llama y lo elimina de nuevo en cuanto termina de " -"ejecutarse . Esto es útil para implementar pruebas para atributos que tu código " -"de producción crea en tiempo de ejecución. Está desactivado por defecto, ya que " -"puede ser peligroso. ¡Al activarlo se pueden implementar pruebas que validen " -"APIs que en realidad no existen!" +"atributo cuando la función se llama y lo elimina de nuevo en cuanto termina " +"de ejecutarse . Esto es útil para implementar pruebas para atributos que tu " +"código de producción crea en tiempo de ejecución. Está desactivado por " +"defecto, ya que puede ser peligroso. ¡Al activarlo se pueden implementar " +"pruebas que validen APIs que en realidad no existen!" #: ../Doc/library/unittest.mock.rst:1387 msgid "" @@ -1488,32 +1516,32 @@ msgstr "" msgid "" "Patch can be used as a :class:`TestCase` class decorator. It works by " "decorating each test method in the class. This reduces the boilerplate code " -"when your test methods share a common patchings set. :func:`patch` finds tests " -"by looking for method names that start with ``patch.TEST_PREFIX``. By default " -"this is ``'test'``, which matches the way :mod:`unittest` finds tests. You can " -"specify an alternative prefix by setting ``patch.TEST_PREFIX``." -msgstr "" -"Path puede ser usado como un decorador de la clase :class:`TestCase`. Funciona " -"decorando cada uno de los métodos de prueba presentes en la clase. Esto reduce " -"el código repetitivo cuando tus métodos de prueba comparten un conjunto de " -"parcheo común. :func:`patch` encuentra las pruebas mediante la búsqueda de " -"métodos cuyos nombres comienzan con ``patch.TEST_PREFIX``. Por defecto es " -"``'test'``, que coincide con la forma en que :mod:`unittest` busca las pruebas. " -"Se puede especificar un prefijo alternativo estableciendo un nuevo valor para " -"el atributo ``patch.TEST_PREFIX``." +"when your test methods share a common patchings set. :func:`patch` finds " +"tests by looking for method names that start with ``patch.TEST_PREFIX``. By " +"default this is ``'test'``, which matches the way :mod:`unittest` finds " +"tests. You can specify an alternative prefix by setting ``patch.TEST_PREFIX``." +msgstr "" +"Path puede ser usado como un decorador de la clase :class:`TestCase`. " +"Funciona decorando cada uno de los métodos de prueba presentes en la clase. " +"Esto reduce el código repetitivo cuando tus métodos de prueba comparten un " +"conjunto de parcheo común. :func:`patch` encuentra las pruebas mediante la " +"búsqueda de métodos cuyos nombres comienzan con ``patch.TEST_PREFIX``. Por " +"defecto es ``'test'``, que coincide con la forma en que :mod:`unittest` busca " +"las pruebas. Se puede especificar un prefijo alternativo estableciendo un " +"nuevo valor para el atributo ``patch.TEST_PREFIX``." #: ../Doc/library/unittest.mock.rst:1398 msgid "" "Patch can be used as a context manager, with the with statement. Here the " -"patching applies to the indented block after the with statement. If you use \"as" -"\" then the patched object will be bound to the name after the \"as\"; very " -"useful if :func:`patch` is creating a mock object for you." +"patching applies to the indented block after the with statement. If you use " +"\"as\" then the patched object will be bound to the name after the \"as\"; " +"very useful if :func:`patch` is creating a mock object for you." msgstr "" -"Patch puede ser usado como un administrador de contexto, con la declaración " -"with. En este caso el parcheo se aplica al bloque sangrado inmediatamente " -"después de la declaración with. Si utilizas \"as\", el objeto parcheado será " -"enlazado al nombre especificado después de \"as\"; muy útil si :func:`patch` " -"está creando un objeto simulado automáticamente." +"Patch puede ser usado como un gestor de contexto, con la declaración with. En " +"este caso el parcheo se aplica al bloque sangrado inmediatamente después de " +"la declaración with. Si utilizas \"as\", el objeto parcheado será enlazado al " +"nombre especificado después de \"as\"; muy útil si :func:`patch` está creando " +"un objeto simulado automáticamente." #: ../Doc/library/unittest.mock.rst:1403 msgid "" @@ -1545,7 +1573,7 @@ msgid "" "the class is instantiated in the code under test then it will be the :attr:" "`~Mock.return_value` of the mock that will be used." msgstr "" -"Parchear una clase sustituye a la clase con una *instancia* de :class:" +"Parchear una clase sustituye a la clase por una *instancia* de :class:" "`MagicMock`. Si la clase se instancia en el código bajo prueba, el atributo :" "attr:`~Mock.return_value` del objeto simulado será el utilizado." @@ -1569,11 +1597,11 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:1441 msgid "" -"If you use *spec* or *spec_set* and :func:`patch` is replacing a *class*, then " -"the return value of the created mock will have the same spec. ::" +"If you use *spec* or *spec_set* and :func:`patch` is replacing a *class*, " +"then the return value of the created mock will have the same spec. ::" msgstr "" -"Si utilizas *spec* o *spec_set* y :func:`patch` está reemplazando una *clase*, " -"el valor de retorno del objeto simulado creado tendrá las mismas " +"Si utilizas *spec* o *spec_set* y :func:`patch` está reemplazando una " +"*clase*, el valor de retorno del objeto simulado creado tendrá las mismas " "especificaciones:" #: ../Doc/library/unittest.mock.rst:1451 @@ -1616,17 +1644,18 @@ msgid "" "func:`patch` call using ``**``::" msgstr "" "Los atributos de los objetos simulados hijos, como :attr:`~Mock.return_value` " -"y :attr:`~Mock.side_effect`, también puede ser configurados en la llamada, dado " -"que los objetos simulados hijos son atributos en si mismos del objeto simulado " -"padre creado. Eso si, estos no son sintácticamente válidos para ser pasados " -"directamente como argumentos por palabras clave a la función patch, pero un " -"diccionario con ellos como claves si que puede ser expandido en una llama a :" -"func:`patch` usando ``**``:" +"y :attr:`~Mock.side_effect`, también puede ser configurados en la llamada, " +"dado que los objetos simulados hijos son atributos en si mismos del objeto " +"simulado padre creado. Eso si, estos no son sintácticamente válidos para ser " +"pasados directamente como argumentos por palabras clave a la función patch, " +"pero un diccionario con ellos como claves si que puede ser expandido en una " +"llama a :func:`patch` usando ``**``:" #: ../Doc/library/unittest.mock.rst:1505 msgid "" "By default, attempting to patch a function in a module (or a method or an " -"attribute in a class) that does not exist will fail with :exc:`AttributeError`::" +"attribute in a class) that does not exist will fail with :exc:" +"`AttributeError`::" msgstr "" "Por defecto, el intento de parchear una función en un módulo (o un método o " "atributo en una clase) que no existe fallará lanzando una excepción :exc:" @@ -1634,8 +1663,8 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:1517 msgid "" -"but adding ``create=True`` in the call to :func:`patch` will make the previous " -"example work as expected::" +"but adding ``create=True`` in the call to :func:`patch` will make the " +"previous example work as expected::" msgstr "" "pero añadir ``create=True`` en la llamada a :func:`patch` hará que el ejemplo " "previo funcione como se esperaba:" @@ -1645,8 +1674,8 @@ msgid "" ":func:`patch` now returns an :class:`AsyncMock` if the target is an async " "function." msgstr "" -":func:`patch` ahora retorna una instancia de :class:`AsyncMock` si el objetivo " -"es una función asíncrona." +":func:`patch` ahora retorna una instancia de :class:`AsyncMock` si el " +"objetivo es una función asíncrona." #: ../Doc/library/unittest.mock.rst:1532 msgid "patch.object" @@ -1654,23 +1683,24 @@ msgstr "patch.object" #: ../Doc/library/unittest.mock.rst:1536 msgid "" -"patch the named member (*attribute*) on an object (*target*) with a mock object." +"patch the named member (*attribute*) on an object (*target*) with a mock " +"object." msgstr "" -"parchea el miembro llamado (*attribute*) en un objeto (*target*) con un objeto " +"parchea el miembro llamado *attribute* de un objeto (*target*) con un objeto " "simulado." #: ../Doc/library/unittest.mock.rst:1539 msgid "" ":func:`patch.object` can be used as a decorator, class decorator or a context " "manager. Arguments *new*, *spec*, *create*, *spec_set*, *autospec* and " -"*new_callable* have the same meaning as for :func:`patch`. Like :func:`patch`, :" -"func:`patch.object` takes arbitrary keyword arguments for configuring the mock " -"object it creates." -msgstr "" -":func:`patch.object` se puede utilizar como un decorador, decorador de clase o " -"un administrador de contexto. Los argumentos *new*, *spec*, *create*, " -"*spec_set*, *autospec* y *new_callable* tienen el mismo significado que en la " -"función :func:`patch`. Al igual que :func:`patch`, :func:`patch.object` toma " +"*new_callable* have the same meaning as for :func:`patch`. Like :func:" +"`patch`, :func:`patch.object` takes arbitrary keyword arguments for " +"configuring the mock object it creates." +msgstr "" +":func:`patch.object` se puede utilizar como un decorador, decorador de clase " +"o un gestor de contexto. Los argumentos *new*, *spec*, *create*, *spec_set*, " +"*autospec* y *new_callable* tienen el mismo significado que en la función :" +"func:`patch`. Al igual que :func:`patch`, :func:`patch.object` toma " "argumentos por palabras clave arbitrarios para la configuración del objeto " "simulado que crea." @@ -1684,28 +1714,28 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:1548 msgid "" -"You can either call :func:`patch.object` with three arguments or two arguments. " -"The three argument form takes the object to be patched, the attribute name and " -"the object to replace the attribute with." +"You can either call :func:`patch.object` with three arguments or two " +"arguments. The three argument form takes the object to be patched, the " +"attribute name and the object to replace the attribute with." msgstr "" -"Puedes llamar a :func:`patch.object` con tres argumentos o con dos argumentos. " -"La forma de tres argumento toma el objeto a parchear, el nombre del atributo y " -"el objeto con el que reemplazar el atributo." +"Puedes llamar a :func:`patch.object` con tres argumentos o con dos " +"argumentos. La forma de tres argumento toma el objeto a parchear, el nombre " +"del atributo y el objeto con el que reemplazar el atributo." #: ../Doc/library/unittest.mock.rst:1552 msgid "" -"When calling with the two argument form you omit the replacement object, and a " -"mock is created for you and passed in as an extra argument to the decorated " +"When calling with the two argument form you omit the replacement object, and " +"a mock is created for you and passed in as an extra argument to the decorated " "function:" msgstr "" -"Al llamar a la forma de dos argumento se omite el objeto de sustitución, por lo " -"tanto se crea un objeto simulado automáticamente y se pasa como argumento " -"adicional a la función decorada:" +"Al llamar usando la variante de dos argumento se omite el objeto de " +"sustitución, por lo tanto se crea un objeto simulado automáticamente y se " +"pasa como argumento adicional a la función decorada:" #: ../Doc/library/unittest.mock.rst:1563 msgid "" -"*spec*, *create* and the other arguments to :func:`patch.object` have the same " -"meaning as they do for :func:`patch`." +"*spec*, *create* and the other arguments to :func:`patch.object` have the " +"same meaning as they do for :func:`patch`." msgstr "" "*spec*, *create* y el resto de argumentos de :func:`patch.object` tienen el " "mismo significado que en la función :func:`patch`." @@ -1719,8 +1749,8 @@ msgid "" "Patch a dictionary, or dictionary like object, and restore the dictionary to " "its original state after the test." msgstr "" -"Parchea un diccionario o un objeto similar a un diccionario y restaurara el " -"diccionario a su estado original una vez terminada la prueba." +"Parchea un diccionario o un objeto similar a un diccionario y posteriormente " +"lo restaura a su estado original una vez terminada la prueba." #: ../Doc/library/unittest.mock.rst:1575 msgid "" @@ -1730,8 +1760,8 @@ msgid "" msgstr "" "*in_dict* puede ser un diccionario o un contenedor similar a uno. Si se trata " "de un objeto similar a un diccionario, debe soportar como mínimo el " -"establecimiento, la obtención y la eliminación de elementos, además de permitir " -"la iteración sobre las claves." +"establecimiento, la obtención y la eliminación de elementos, además de " +"permitir la iteración sobre las claves." #: ../Doc/library/unittest.mock.rst:1579 msgid "" @@ -1739,8 +1769,8 @@ msgid "" "will then be fetched by importing it." msgstr "" "*in_dict* también puede ser una cadena que especifique el nombre del " -"diccionario a parchear, el nombre es usado para obtener el diccionario mediante " -"importación." +"diccionario a parchear, el nombre es usado para obtener el diccionario " +"mediante importación." #: ../Doc/library/unittest.mock.rst:1582 msgid "" @@ -1772,25 +1802,25 @@ msgid "" ":func:`patch.dict` now returns the patched dictionary when used as a context " "manager." msgstr "" -"La función :func:`patch.dict` ahora retorna el diccionario parcheado cuando se " -"utiliza como administrador de contexto." +"La función :func:`patch.dict` ahora retorna el diccionario parcheado cuando " +"se utiliza como gestor de contexto." #: ../Doc/library/unittest.mock.rst:1596 msgid "" ":func:`patch.dict` can be used as a context manager, decorator or class " "decorator:" msgstr "" -":func:`patch.dict` se puede utilizar como administrador de contexto, decorador " -"o decorador de clase:" +":func:`patch.dict` se puede utilizar como gestor de contexto, decorador o " +"decorador de clase:" #: ../Doc/library/unittest.mock.rst:1606 msgid "" -"When used as a class decorator :func:`patch.dict` honours ``patch.TEST_PREFIX`` " -"(default to ``'test'``) for choosing which methods to wrap:" +"When used as a class decorator :func:`patch.dict` honours ``patch." +"TEST_PREFIX`` (default to ``'test'``) for choosing which methods to wrap:" msgstr "" "Cuando se utiliza :func:`patch.dict` como decorador de clase, se rige por " -"``patch.TEST_PREFIX`` (por defecto ``'test'``) a la hora de elegir qué métodos " -"envolver:" +"``patch.TEST_PREFIX`` (por defecto ``'test'``) a la hora de elegir qué " +"métodos envolver:" #: ../Doc/library/unittest.mock.rst:1617 msgid "" @@ -1799,41 +1829,41 @@ msgid "" "details about how to change the value of see :ref:`test-prefix`." msgstr "" "Si deseas utilizar un prefijo diferente para tu prueba, puede informar a los " -"parcheadores del nuevo prefijo a usar estableciendo ``patch.TEST_PREFIX``. Para " -"más detalles sobre cómo cambiar el valor del atributo consultar :ref:`test-" -"prefix`." +"parcheadores del nuevo prefijo a usar estableciendo ``patch.TEST_PREFIX``. " +"Para más detalles sobre cómo cambiar el valor del atributo consultar :ref:" +"`test-prefix`." #: ../Doc/library/unittest.mock.rst:1621 msgid "" -":func:`patch.dict` can be used to add members to a dictionary, or simply let a " -"test change a dictionary, and ensure the dictionary is restored when the test " -"ends." +":func:`patch.dict` can be used to add members to a dictionary, or simply let " +"a test change a dictionary, and ensure the dictionary is restored when the " +"test ends." msgstr "" ":func:`patch.dict` puede utilizarse para agregar miembros a un diccionario, o " -"simplemente dejar que una prueba modifique un diccionario, y asegurar que el " -"diccionario será restablecido cuando finalice la misma." +"simplemente para dejar que una prueba modifique un diccionario y asegurarte " +"de que el diccionario será restablecido cuando finalice la misma." #: ../Doc/library/unittest.mock.rst:1642 msgid "" "Keywords can be used in the :func:`patch.dict` call to set values in the " "dictionary:" msgstr "" -"Los argumentos por palabra clave pueden ser utilizados en la llamada a :func:" -"`patch.dict` para establecer valores en el diccionario:" +"Se pueden utilizar argumentos por palabra clave en la llamada a :func:`patch." +"dict` para establecer valores en el diccionario:" #: ../Doc/library/unittest.mock.rst:1652 msgid "" ":func:`patch.dict` can be used with dictionary like objects that aren't " "actually dictionaries. At the very minimum they must support item getting, " -"setting, deleting and either iteration or membership test. This corresponds to " -"the magic methods :meth:`__getitem__`, :meth:`__setitem__`, :meth:`__delitem__` " -"and either :meth:`__iter__` or :meth:`__contains__`." +"setting, deleting and either iteration or membership test. This corresponds " +"to the magic methods :meth:`__getitem__`, :meth:`__setitem__`, :meth:" +"`__delitem__` and either :meth:`__iter__` or :meth:`__contains__`." msgstr "" ":func:`patch.dict` se puede utilizar con objetos similares a un diccionario, " "que no son realmente diccionarios. Estos objetos como mínimo deben permitir " "obtener, establecer y borrar elementos, además de soportar la iteración o la " "prueba de pertenencia. Dichas funcionalidades se corresponden a los métodos " -"mágicos :meth:`__getitem__`, :meth:`__setitem__`, :meth:`__delitem__` y :meth:" +"mágicos :meth:`__getitem__`, :meth:`__setitem__`, :meth:`__delitem__` e :meth:" "`__iter__` o :meth:`__contains__`." #: ../Doc/library/unittest.mock.rst:1681 @@ -1843,8 +1873,8 @@ msgstr "patch.multiple" #: ../Doc/library/unittest.mock.rst:1685 msgid "" "Perform multiple patches in a single call. It takes the object to be patched " -"(either as an object or a string to fetch the object by importing) and keyword " -"arguments for the patches::" +"(either as an object or a string to fetch the object by importing) and " +"keyword arguments for the patches::" msgstr "" "Realiza múltiples parches en una sola llamada. Se toma el objeto a ser " "parcheado (ya sea como un objeto o una cadena de caracteres con el nombre del " @@ -1858,21 +1888,21 @@ msgid "" "function by keyword, and a dictionary is returned when :func:`patch.multiple` " "is used as a context manager." msgstr "" -"Usa :data:`DEFAULT` como valor si deseas que la función :func:`patch.multiple` " -"cree objetos simulados automáticamente por ti. En este caso, los objetos " -"simulados creados son pasados ​​a una función decorada mediante palabra clave y " -"se retorna un diccionario cuando :func:`patch.multiple` se utiliza como " -"administrador de contexto." +"Usa :data:`DEFAULT` como valor si deseas que la función :func:`patch." +"multiple` cree objetos simulados automáticamente por ti. En este caso, los " +"objetos simulados creados son pasados ​​a la función decorada mediante palabra " +"clave y se retorna un diccionario cuando :func:`patch.multiple` se utiliza " +"como gestor de contexto." #: ../Doc/library/unittest.mock.rst:1697 msgid "" -":func:`patch.multiple` can be used as a decorator, class decorator or a context " -"manager. The arguments *spec*, *spec_set*, *create*, *autospec* and " -"*new_callable* have the same meaning as for :func:`patch`. These arguments will " -"be applied to *all* patches done by :func:`patch.multiple`." +":func:`patch.multiple` can be used as a decorator, class decorator or a " +"context manager. The arguments *spec*, *spec_set*, *create*, *autospec* and " +"*new_callable* have the same meaning as for :func:`patch`. These arguments " +"will be applied to *all* patches done by :func:`patch.multiple`." msgstr "" "La función :func:`patch.multiple` se puede utilizar como un decorador, " -"decorador de clase o como administrador de contexto. La argumentos *spec*, " +"decorador de clase o como gestor de contexto. La argumentos *spec*, " "*spec_set*, *create*, *autospec* y *new_callable* tienen el mismo significado " "que en la función :func:`patch`. Estos argumentos se aplicarán a *todos* los " "parches realizados por :func:`patch.multiple`." @@ -1891,10 +1921,10 @@ msgid "" "data:`DEFAULT` as the value. If you use :func:`patch.multiple` as a decorator " "then the created mocks are passed into the decorated function by keyword. ::" msgstr "" -"Si deseas que :func:`patch.multiple` cree objetos simulados automáticamente por " -"ti, puedes utilizar :data:`DEFAULT` como valor. Si utilizas :func:`patch." -"multiple` como decorador, entonces los objetos simulados creados se pasan a la " -"función decorada por palabra clave:" +"Si deseas que :func:`patch.multiple` cree objetos simulados automáticamente " +"por ti, puedes utilizar :data:`DEFAULT` como valor. Si utilizas :func:`patch." +"multiple` como decorador, entonces los objetos simulados creados se pasan a " +"la función decorada por palabra clave:" #: ../Doc/library/unittest.mock.rst:1719 msgid "" @@ -1911,13 +1941,13 @@ msgid "" "If :func:`patch.multiple` is used as a context manager, the value returned by " "the context manager is a dictionary where created mocks are keyed by name::" msgstr "" -"Si :func:`patch.multiple` se utiliza como un administrador de contexto, el " -"valor retornado por el mismo es un diccionario en el que los objetos simulados " -"creados son almacenados usando sus nombres como claves:" +"Si :func:`patch.multiple` se utiliza como un gestor de contexto, el valor " +"retornado por el mismo es un diccionario en el que los objetos simulados " +"creados son almacenados, usando sus nombres como claves:" #: ../Doc/library/unittest.mock.rst:1745 msgid "patch methods: start and stop" -msgstr "métodos de patch: start y stop" +msgstr "Métodos start y stop de patch" #: ../Doc/library/unittest.mock.rst:1747 msgid "" @@ -1927,7 +1957,7 @@ msgid "" msgstr "" "Todos los parcheadores tienen los métodos :meth:`start` y :meth:`stop`. Esto " "facilita parchear en los métodos ``setUp`` o cuando deseas hacer múltiples " -"parches sin decoradores anidados o declaraciones with." +"parches sin usar decoradores anidados o declaraciones with." #: ../Doc/library/unittest.mock.rst:1751 msgid "" @@ -1935,10 +1965,10 @@ msgid "" "normal and keep a reference to the returned ``patcher`` object. You can then " "call :meth:`start` to put the patch in place and :meth:`stop` to undo it." msgstr "" -"Para utilizarlos llama a :func:`patch`, :func:`patch.object` o :func:`patch." -"dict` como haces normalmente y mantén una referencia al objeto ``patcher`` " -"retornado. A continuación, puedes llamar al método :meth:`start` para aplicar " -"el parche y a :meth:`stop` para deshacerlo." +"Para utilizarlos estos métodos, llama a :func:`patch`, :func:`patch.object` " +"o :func:`patch.dict` como haces normalmente y mantén una referencia al objeto " +"``patcher`` retornado. A continuación, puedes llamar al método :meth:`start` " +"para aplicar el parche y a :meth:`stop` para deshacerlo." #: ../Doc/library/unittest.mock.rst:1755 msgid "" @@ -1953,7 +1983,7 @@ msgid "" "A typical use case for this might be for doing multiple patches in the " "``setUp`` method of a :class:`TestCase`::" msgstr "" -"Un uso típico para esto podría ser hacer múltiples parches en el método " +"Un uso típico de esto podría ser realizar múltiples parches en el método " "``setUp`` de un :class:`TestCase`:" #: ../Doc/library/unittest.mock.rst:1791 @@ -1963,23 +1993,24 @@ msgid "" "exception is raised in the ``setUp`` then ``tearDown`` is not called. :meth:" "`unittest.TestCase.addCleanup` makes this easier::" msgstr "" -"Si se utiliza esta técnica debes asegurarte de que el parcheo está \"sin aplicar" -"\" llamando a ``stop``. Esto puede ser más complicado de lo que parece, ya que " -"si se produce una excepción en el ``setUp`` no se llama a `tearDown`` a " -"continuación. :meth:`unittest.TestCase.addCleanup` hace que esto sea más fácil:" +"Si se utiliza esta técnica debes asegurarte de que el parcheo está \"sin " +"aplicar\" llamando a ``stop``. Esto puede ser más complicado de lo que " +"parece, ya que si se produce una excepción en el ``setUp`` no se llama a " +"``tearDown`` a continuación. :meth:`unittest.TestCase.addCleanup` hace que " +"esto sea más fácil:" #: ../Doc/library/unittest.mock.rst:1806 msgid "" "As an added bonus you no longer need to keep a reference to the ``patcher`` " "object." msgstr "" -"Como beneficio adicional ya no es necesario mantener una referencia al objeto " -"``patcher``." +"Como beneficio adicional, ya no es necesario mantener una referencia al " +"objeto ``patcher``." #: ../Doc/library/unittest.mock.rst:1809 msgid "" -"It is also possible to stop all patches which have been started by using :func:" -"`patch.stopall`." +"It is also possible to stop all patches which have been started by using :" +"func:`patch.stopall`." msgstr "" "También es posible detener todos los parches que han sido iniciados usando :" "func:`patch.stopall`." @@ -1992,15 +2023,15 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:1820 msgid "patch builtins" -msgstr "parchear objetos incorporados (builtins)" +msgstr "Parchear objetos incorporados (builtins)" #: ../Doc/library/unittest.mock.rst:1821 msgid "" "You can patch any builtins within a module. The following example patches " "builtin :func:`ord`::" msgstr "" -"Puedes parchear cualquier objeto incorporado dentro de un módulo. El siguiente " -"ejemplo parchea la función incorporada :func:`ord`:" +"Puedes parchear cualquier objeto incorporado dentro de un módulo. El " +"siguiente ejemplo parchea la función incorporada :func:`ord`:" #: ../Doc/library/unittest.mock.rst:1836 msgid "TEST_PREFIX" @@ -2008,25 +2039,26 @@ msgstr "TEST_PREFIX" #: ../Doc/library/unittest.mock.rst:1838 msgid "" -"All of the patchers can be used as class decorators. When used in this way they " -"wrap every test method on the class. The patchers recognise methods that start " -"with ``'test'`` as being test methods. This is the same way that the :class:" -"`unittest.TestLoader` finds test methods by default." +"All of the patchers can be used as class decorators. When used in this way " +"they wrap every test method on the class. The patchers recognise methods that " +"start with ``'test'`` as being test methods. This is the same way that the :" +"class:`unittest.TestLoader` finds test methods by default." msgstr "" "Todos los parcheadores se puede utilizar como decoradores de clase. Cuando se " "usan de esta forma, todos los métodos a probar en la clase son envueltos. Los " -"parcheadores reconocen los métodos que comienzan con ``'test'`` como métodos a " -"probar. Esta es la misma forma que la clase :class:`unittest.TestLoader` usa " -"para encontrar métodos de prueba por defecto." +"parcheadores reconocen los métodos que comienzan con ``'test'`` como métodos " +"a probar. Esta es la misma forma que la clase :class:`unittest.TestLoader` " +"usa para encontrar métodos de prueba por defecto." #: ../Doc/library/unittest.mock.rst:1843 msgid "" -"It is possible that you want to use a different prefix for your tests. You can " -"inform the patchers of the different prefix by setting ``patch.TEST_PREFIX``::" +"It is possible that you want to use a different prefix for your tests. You " +"can inform the patchers of the different prefix by setting ``patch." +"TEST_PREFIX``::" msgstr "" "Cabe la posibilidad de que desees utilizar un prefijo diferente para las " -"pruebas. Puedes informar a los parcheadores del cambio de prefijo estableciendo " -"el atributo ``patch.TEST_PREFIX``:" +"pruebas. Puedes informar a los parcheadores del cambio de prefijo " +"estableciendo el atributo ``patch.TEST_PREFIX``:" #: ../Doc/library/unittest.mock.rst:1866 msgid "Nesting Patch Decorators" @@ -2041,7 +2073,7 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:1871 msgid "You can stack up multiple patch decorators using this pattern:" -msgstr "Puede apilar múltiples decoradores path siguiendo el siguiente patrón:" +msgstr "Puede apilar múltiples decoradores path usando el siguiente patrón:" #: ../Doc/library/unittest.mock.rst:1887 msgid "" @@ -2049,10 +2081,10 @@ msgid "" "standard way that Python applies decorators. The order of the created mocks " "passed into your test function matches this order." msgstr "" -"Ten en cuenta que los decoradores se aplican desde abajo hacia arriba. Esta es " -"la manera estándar de Python para aplicar decoradores. El orden en el que los " -"objetos simulados generados se pasan a la función de prueba coincide con este " -"orden." +"Ten en cuenta que los decoradores se aplican desde abajo hacia arriba. Esta " +"es la manera estándar de Python para aplicar decoradores. El orden en el que " +"los objetos simulados generados se pasan a la función de prueba coincide con " +"este orden." #: ../Doc/library/unittest.mock.rst:1895 msgid "Where to patch" @@ -2061,46 +2093,47 @@ msgstr "Dónde parchear" #: ../Doc/library/unittest.mock.rst:1897 msgid "" ":func:`patch` works by (temporarily) changing the object that a *name* points " -"to with another one. There can be many names pointing to any individual object, " -"so for patching to work you must ensure that you patch the name used by the " -"system under test." +"to with another one. There can be many names pointing to any individual " +"object, so for patching to work you must ensure that you patch the name used " +"by the system under test." msgstr "" -":func:`patch` funciona cambiando (temporalmente) el objeto al que apunta *name* " -"con otro. Puede haber muchos nombres apuntando a cualquier objeto individual, " -"por lo que para que el parcheo funcione, debes asegurarte de parchear el nombre " -"utilizado por el sistema concreto bajo prueba." +":func:`patch` funciona cambiando (temporalmente) el objeto al que apunta " +"*name* con otro. Puede haber muchos nombres apuntando a cualquier objeto " +"individual, por lo que para que el parcheo funcione, debes asegurarte de " +"parchear el nombre utilizado para el objeto por el sistema concreto bajo " +"prueba." #: ../Doc/library/unittest.mock.rst:1902 msgid "" -"The basic principle is that you patch where an object is *looked up*, which is " -"not necessarily the same place as where it is defined. A couple of examples " -"will help to clarify this." +"The basic principle is that you patch where an object is *looked up*, which " +"is not necessarily the same place as where it is defined. A couple of " +"examples will help to clarify this." msgstr "" "El principio básico es parchear donde un objeto es *buscado*, que no es " -"necesariamente el mismo lugar donde está definido. Un par de ejemplos ayudarán " -"a aclarar esto." +"necesariamente el mismo lugar donde está definido. Un par de ejemplos " +"ayudarán a aclarar esto." #: ../Doc/library/unittest.mock.rst:1906 msgid "" "Imagine we have a project that we want to test with the following structure::" msgstr "" -"Imaginemos que tenemos un proyecto que queremos probar con la siguiente " +"Imaginemos que tenemos un proyecto, que queremos probar, con la siguiente " "estructura:" #: ../Doc/library/unittest.mock.rst:1915 msgid "" "Now we want to test ``some_function`` but we want to mock out ``SomeClass`` " -"using :func:`patch`. The problem is that when we import module b, which we will " -"have to do then it imports ``SomeClass`` from module a. If we use :func:`patch` " -"to mock out ``a.SomeClass`` then it will have no effect on our test; module b " -"already has a reference to the *real* ``SomeClass`` and it looks like our " -"patching had no effect." +"using :func:`patch`. The problem is that when we import module b, which we " +"will have to do then it imports ``SomeClass`` from module a. If we use :func:" +"`patch` to mock out ``a.SomeClass`` then it will have no effect on our test; " +"module b already has a reference to the *real* ``SomeClass`` and it looks " +"like our patching had no effect." msgstr "" "Ahora queremos probar ``some_function``, pero queremos simular ``SomeClass`` " -"utilizando :func:`patch`. El problema es que cuando importamos el módulo b, lo " -"cual tenemos que hacer obligatoriamente, se importa ``SomeClass`` del módulo a. " -"Si utilizamos :func:`patch` para simular ``a.SomeClass`` no tendrá ningún " -"efecto en nuestra prueba; el módulo b ya tiene una referencia a la " +"utilizando :func:`patch`. El problema es que cuando importamos el módulo b, " +"lo cual tenemos que hacer obligatoriamente, se importa ``SomeClass`` del " +"módulo a. Si utilizamos :func:`patch` para simular ``a.SomeClass``, no tendrá " +"ningún efecto en nuestra prueba; el módulo b ya tiene una referencia a la " "``SomeClass`` *real*, por lo que parece que nuestro parcheo no tuvo ningún " "efecto." @@ -2111,8 +2144,8 @@ msgid "" "module b, where we have imported it. The patching should look like::" msgstr "" "La clave es parchear ``SomeClass`` donde se utiliza (o donde es buscado). En " -"este caso ``some_function`` realmente va a buscar ``SomeClass`` en el módulo b, " -"donde lo hemos importado. La aplicación de parches debe ser similar a:" +"este caso ``some_function`` realmente va a buscar ``SomeClass`` en el módulo " +"b, donde lo hemos importado. La aplicación de parches debe ser similar a:" #: ../Doc/library/unittest.mock.rst:1928 msgid "" @@ -2124,8 +2157,8 @@ msgid "" msgstr "" "Sin embargo, ten en cuenta el escenario alternativo donde en el módulo b en " "lugar de ``from a import SomeClass`` se hace ``import a`` y ``some_function`` " -"usa ``a.SomeClass``. Ambas formas de importación son comunes. En este caso, la " -"clase que queremos parchear está siendo buscada en el módulo, por lo que " +"usa ``a.SomeClass``. Ambas formas de importación son comunes. En este caso, " +"la clase que queremos parchear está siendo buscada en el módulo, por lo que " "tenemos que parchear ``a.SomeClass``:" #: ../Doc/library/unittest.mock.rst:1937 @@ -2137,13 +2170,13 @@ msgid "" "Both patch_ and patch.object_ correctly patch and restore descriptors: class " "methods, static methods and properties. You should patch these on the *class* " "rather than an instance. They also work with *some* objects that proxy " -"attribute access, like the `django settings object `_." +"attribute access, like the `django settings object `_." msgstr "" "Tanto patch_ como patch.object_ parchean descriptores correctamente y los " "restauran posteriormente: métodos de clase, métodos estáticos y propiedades. " -"Los descriptores deben ser parcheados en la *class* en lugar de una instancia. " -"También trabajan *algunos* objetos que actuan como proxy en el acceso a " +"Los descriptores deben ser parcheados en la *clase* y no en una instancia. " +"También funcionan con *algunos* objetos que actúan como proxy en el acceso a " "atributos, como `los objetos de configuración de django `_." @@ -2163,21 +2196,21 @@ msgid "" msgstr "" ":class:`Mock` soporta la simulación de los métodos de protocolo de Python, " "también conocidos como \"métodos mágicos\". Esto permite a los objetos " -"simulados reemplazar contenedores u otros objetos que implementan protocolos de " -"Python." +"simulados reemplazar contenedores u otros objetos que implementan protocolos " +"de Python." #: ../Doc/library/unittest.mock.rst:1958 msgid "" -"Because magic methods are looked up differently from normal methods [#]_, this " -"support has been specially implemented. This means that only specific magic " -"methods are supported. The supported list includes *almost* all of them. If " -"there are any missing that you need please let us know." +"Because magic methods are looked up differently from normal methods [#]_, " +"this support has been specially implemented. This means that only specific " +"magic methods are supported. The supported list includes *almost* all of " +"them. If there are any missing that you need please let us know." msgstr "" "Dado que los métodos mágicos se buscan de manera diferente a los métodos " -"normales [#] _, este soporte ha sido especialmente implementado. Esto significa " -"que sólo es compatible con métodos mágicos específicos. La lista de métodos " -"soportados incluye *casi* todos los existentes . Si hay alguno que falta y que " -"consideras necesario, por favor háznoslo saber." +"normales [#]_, este soporte ha sido especialmente implementado. Esto " +"significa que sólo es compatible con métodos mágicos específicos. La lista de " +"métodos soportados incluye *casi* todos los existentes. Si hay alguno que " +"falta y que consideras necesario, por favor háznoslo saber." #: ../Doc/library/unittest.mock.rst:1963 msgid "" @@ -2187,15 +2220,15 @@ msgid "" msgstr "" "Puedes simular métodos mágicos estableciendo el método que te interesa en una " "función o en una instancia simulada. Si utilizas una función, *debe* aceptar " -"``self`` como primer argumento [#] _." +"``self`` como primer argumento [#]_." #: ../Doc/library/unittest.mock.rst:1986 msgid "" "One use case for this is for mocking objects used as context managers in a :" "keyword:`with` statement:" msgstr "" -"Un caso de uso para esto es simular objetos usados ​​como administradores de " -"contexto en una declaración :keyword:`with`:" +"Un caso de uso para esto es simular objetos usados ​​como gestores de contexto " +"en una declaración :keyword:`with`:" #: ../Doc/library/unittest.mock.rst:1998 msgid "" @@ -2207,8 +2240,8 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:2003 msgid "" -"If you use the *spec* keyword argument to create a mock then attempting to set " -"a magic method that isn't in the spec will raise an :exc:`AttributeError`." +"If you use the *spec* keyword argument to create a mock then attempting to " +"set a magic method that isn't in the spec will raise an :exc:`AttributeError`." msgstr "" "Si se utiliza el argumento por palabra clave *spec* para crear un objeto " "simulado, intentar después establecer un método mágico que no está en la " @@ -2245,7 +2278,8 @@ msgid "" "``__missing__``" msgstr "" "Métodos de contenedores: ``__getitem__``, ``__setitem__``, ``__delitem__``, " -"``__contains__``, ``__len__``, ``__iter__``, ``__reversed__`` y ``__missing__``" +"``__contains__``, ``__len__``, ``__iter__``, ``__reversed__`` y " +"``__missing__``" #: ../Doc/library/unittest.mock.rst:2016 msgid "" @@ -2260,15 +2294,17 @@ msgstr "Métodos numéricos unarios: ``__neg__``, ``__pos__`` y ``__invert__``" #: ../Doc/library/unittest.mock.rst:2018 msgid "" -"The numeric methods (including right hand and in-place variants): ``__add__``, " -"``__sub__``, ``__mul__``, ``__matmul__``, ``__div__``, ``__truediv__``, " -"``__floordiv__``, ``__mod__``, ``__divmod__``, ``__lshift__``, ``__rshift__``, " -"``__and__``, ``__xor__``, ``__or__``, and ``__pow__``" +"The numeric methods (including right hand and in-place variants): " +"``__add__``, ``__sub__``, ``__mul__``, ``__matmul__``, ``__div__``, " +"``__truediv__``, ``__floordiv__``, ``__mod__``, ``__divmod__``, " +"``__lshift__``, ``__rshift__``, ``__and__``, ``__xor__``, ``__or__``, and " +"``__pow__``" msgstr "" -"Los métodos numéricos (incluyendo métodos estándar y las variantes in-" -"placunie): ``__add__``, ``__sub__``, ``__mul__``, ``__matmul__``, ``__div__``, " -"``__truediv__``, ``__floordiv__``, ``__mod__``, ``__divmod__``, ``__lshift__``, " -"``__rshift__``, ``__and__``, ``__xor__``, ``__or__``, y ``__pow__``" +"Los métodos numéricos (incluyendo los métodos estándar y las variantes in-" +"place): ``__add__``, ``__sub__``, ``__mul__``, ``__matmul__``, ``__div__``, " +"``__truediv__``, ``__floordiv__``, ``__mod__``, ``__divmod__``, " +"``__lshift__``, ``__rshift__``, ``__and__``, ``__xor__``, ``__or__``, y " +"``__pow__``" #: ../Doc/library/unittest.mock.rst:2022 msgid "" @@ -2324,7 +2360,8 @@ msgid "``__getattr__``, ``__setattr__``, ``__init__`` and ``__new__``" msgstr "``__getattr__``, ``__setattr__``, ``__init__`` y ``__new__``" #: ../Doc/library/unittest.mock.rst:2041 -msgid "``__prepare__``, ``__instancecheck__``, ``__subclasscheck__``, ``__del__``" +msgid "" +"``__prepare__``, ``__instancecheck__``, ``__subclasscheck__``, ``__del__``" msgstr "" "``__prepare__``, ``__instancecheck__``, ``__subclasscheck__`` y ``__del__``" @@ -2346,14 +2383,16 @@ msgid "" "most of the magic methods. You can use ``MagicMock`` without having to " "configure the magic methods yourself." msgstr "" -"``MagicMock`` es una subclase de :class:`Mock` con implementaciones por defecto " -"de la mayoría de los métodos mágicos. Puedes utilizar ``MagicMock`` para crear " -"objetos simulados sin tener que establecer los métodos mágicos por ti mismo." +"``MagicMock`` es una subclase de :class:`Mock` con implementaciones por " +"defecto de la mayoría de los métodos mágicos. Puedes utilizar ``MagicMock`` " +"para crear objetos simulados sin tener que establecer los métodos mágicos por " +"ti mismo." #: ../Doc/library/unittest.mock.rst:2057 msgid "The constructor parameters have the same meaning as for :class:`Mock`." msgstr "" -"Los parámetros del constructor tienen el mismo significado que en :class:`Mock`." +"Los parámetros del constructor tienen el mismo significado que en :class:" +"`Mock`." #: ../Doc/library/unittest.mock.rst:2059 msgid "" @@ -2370,8 +2409,8 @@ msgstr "Una versión no invocable de :class:`MagicMock`." #: ../Doc/library/unittest.mock.rst:2067 msgid "" "The constructor parameters have the same meaning as for :class:`MagicMock`, " -"with the exception of *return_value* and *side_effect* which have no meaning on " -"a non-callable mock." +"with the exception of *return_value* and *side_effect* which have no meaning " +"on a non-callable mock." msgstr "" "Los parámetros del constructor tienen el mismo significado que en :class:" "`MagicMock`, con la excepción de *return_value* y *side_effect* que no tienen " @@ -2388,17 +2427,17 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:2081 msgid "" "By default many of the protocol methods are required to return objects of a " -"specific type. These methods are preconfigured with a default return value, so " -"that they can be used without you having to do anything if you aren't " +"specific type. These methods are preconfigured with a default return value, " +"so that they can be used without you having to do anything if you aren't " "interested in the return value. You can still *set* the return value manually " "if you want to change the default." msgstr "" "Por defecto, muchos de los métodos de protocolo están obligados a retornar " -"objetos de un tipo específico. Estos métodos están preconfigurados con un valor " -"de retorno por defecto, de manera que puedan ser utilizados sin tener que hacer " -"nada más, si no estás interesado en el valor de retorno. En todo caso, puedes " -"*establecer* el valor de retorno de forma manual si deseas cambiar el valor " -"predeterminado." +"objetos de un tipo específico. Estos métodos están preconfigurados con un " +"valor de retorno por defecto, de manera que puedan ser utilizados sin tener " +"que hacer nada más, siempre que no estés interesado en el valor de retorno. " +"En todo caso, puedes *establecer* el valor de retorno de forma manual si " +"deseas cambiar el valor predeterminado." #: ../Doc/library/unittest.mock.rst:2087 msgid "Methods and their defaults:" @@ -2462,15 +2501,15 @@ msgstr "``__index__``: ``1``" #: ../Doc/library/unittest.mock.rst:2103 msgid "``__hash__``: default hash for the mock" -msgstr "``__hash__``: hash usado por defecto para el objeto simulado" +msgstr "``__hash__``: hash predeterminado del objeto simulado" #: ../Doc/library/unittest.mock.rst:2104 msgid "``__str__``: default str for the mock" -msgstr "``__str__``: str por defecto para del objeto simulado" +msgstr "``__str__``: str predeterminado del objeto simulado" #: ../Doc/library/unittest.mock.rst:2105 msgid "``__sizeof__``: default sizeof for the mock" -msgstr "``__sizeof__``: sizeof por defecto del objeto simulado" +msgstr "``__sizeof__``: sizeof predeterminado del objeto simulado" #: ../Doc/library/unittest.mock.rst:2107 msgid "For example:" @@ -2478,15 +2517,15 @@ msgstr "Por ejemplo:" #: ../Doc/library/unittest.mock.rst:2119 msgid "" -"The two equality methods, :meth:`__eq__` and :meth:`__ne__`, are special. They " -"do the default equality comparison on identity, using the :attr:`~Mock." +"The two equality methods, :meth:`__eq__` and :meth:`__ne__`, are special. " +"They do the default equality comparison on identity, using the :attr:`~Mock." "side_effect` attribute, unless you change their return value to return " "something else::" msgstr "" "Los dos métodos de igualdad, :meth:`__eq__` y :meth:`__ne__`, son especiales. " "Realizan la comparación de igualdad predeterminada basada en la identidad, " -"utilizando el atributo :attr:`~Mock.side_effect`, a menos que cambies su valor " -"de retorno para que retorne alguna otra cosa:" +"utilizando el atributo :attr:`~Mock.side_effect`, a menos que cambies su " +"valor de retorno para que retorne alguna otra cosa:" #: ../Doc/library/unittest.mock.rst:2133 msgid "" @@ -2498,16 +2537,16 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:2143 msgid "" -"If the return value *is* an iterator, then iterating over it once will consume " -"it and subsequent iterations will result in an empty list:" +"If the return value *is* an iterator, then iterating over it once will " +"consume it and subsequent iterations will result in an empty list:" msgstr "" -"Si el valor de retorno *es* un iterador, al iterar sobre él una vez que se " -"consuma y todas las iteraciones subsiguientes resultarán en una lista vacía:" +"Si el valor de retorno *es* un iterador, iterar sobre él una vez que se " +"consume, y cualquier iteración posterior, resultará en una lista vacía:" #: ../Doc/library/unittest.mock.rst:2152 msgid "" -"``MagicMock`` has all of the supported magic methods configured except for some " -"of the obscure and obsolete ones. You can still set these up if you want." +"``MagicMock`` has all of the supported magic methods configured except for " +"some of the obscure and obsolete ones. You can still set these up if you want." msgstr "" "``MagicMock`` tiene todos los métodos mágicos soportados configurados a " "excepción de algunos de los más oscuros y obsoletos. De todas formas, puedes " @@ -2515,9 +2554,10 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:2155 msgid "" -"Magic methods that are supported but not setup by default in ``MagicMock`` are:" +"Magic methods that are supported but not setup by default in ``MagicMock`` " +"are:" msgstr "" -"Los métodos mágicos que son compatibles pero que no están configurados por " +"Los métodos mágicos que son compatibles, pero que no están configurados por " "defecto en ``MagicMock`` son:" #: ../Doc/library/unittest.mock.rst:2157 @@ -2565,11 +2605,11 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:2172 msgid "" -"The function is basically hooked up to the class, but each ``Mock`` instance is " -"kept isolated from the others." +"The function is basically hooked up to the class, but each ``Mock`` instance " +"is kept isolated from the others." msgstr "" -"La función está básicamente conectada a la clase, pero cada instancia ``Mock`` " -"se mantiene aislada de las demás." +"La función está básicamente conectada a la clase, pero cada instancia " +"``Mock`` se mantiene aislada de las demás." #: ../Doc/library/unittest.mock.rst:2177 msgid "Helpers" @@ -2590,13 +2630,13 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:2187 msgid "" "Attributes are created on demand when you access them by name. Accessing the " -"same attribute will always return the same object. The objects returned have a " -"sensible repr so that test failure messages are readable." +"same attribute will always return the same object. The objects returned have " +"a sensible repr so that test failure messages are readable." msgstr "" "Los atributos se crean a demanda, en el instante en el que se accede a ellos " -"por su nombre por primera vez. El acceso al mismo atributo siempre retornará el " -"mismo objeto. Los objetos retornados tienen una reproducción (repr) apropiada " -"para que los mensajes de error de la prueba sean legibles." +"por su nombre por primera vez. El acceso al mismo atributo siempre retornará " +"el mismo objeto. Los objetos retornados tienen una reproducción (repr) " +"apropiada para que los mensajes de error de la prueba sean legibles." #: ../Doc/library/unittest.mock.rst:2191 msgid "" @@ -2608,22 +2648,23 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:2195 msgid "" -"Sometimes when testing you need to test that a specific object is passed as an " -"argument to another method, or returned. It can be common to create named " +"Sometimes when testing you need to test that a specific object is passed as " +"an argument to another method, or returned. It can be common to create named " "sentinel objects to test this. :data:`sentinel` provides a convenient way of " "creating and testing the identity of objects like this." msgstr "" -"A veces, cuando implementas pruebas, necesitas probar que un determinado objeto " -"se pasa como argumento a otro método, o se retorna. Puede ser común crear " -"objetos centinela con un nombre para probar esto. :data:`sentinel` proporciona " -"una manera conveniente de crear y probar la identidad de los objetos de este " -"tipo." +"A veces, cuando implementas pruebas, necesitas probar que un determinado " +"objeto se pasa como argumento a otro método, o se retorna. Crear objetos " +"centinela con un nombre para probar esto puede ser una práctica común. :data:" +"`sentinel` proporciona una manera conveniente de crear y probar la identidad " +"de este tipo de objetos." #: ../Doc/library/unittest.mock.rst:2200 msgid "" "In this example we monkey patch ``method`` to return ``sentinel.some_object``:" msgstr "" -"En este ejemplo, parcheamos ``method`` para retornar ``sentinel.some_object``:" +"En el siguiente ejemplo, parcheamos ``method`` para retornar ``sentinel." +"some_object``:" #: ../Doc/library/unittest.mock.rst:2212 msgid "DEFAULT" @@ -2647,13 +2688,13 @@ msgstr "call" msgid "" ":func:`call` is a helper object for making simpler assertions, for comparing " "with :attr:`~Mock.call_args`, :attr:`~Mock.call_args_list`, :attr:`~Mock." -"mock_calls` and :attr:`~Mock.method_calls`. :func:`call` can also be used with :" -"meth:`~Mock.assert_has_calls`." +"mock_calls` and :attr:`~Mock.method_calls`. :func:`call` can also be used " +"with :meth:`~Mock.assert_has_calls`." msgstr "" -":func:`call` es un objeto ayudante para hacer aserciones simples, para comparar " -"con :attr:`~Mock.call_args`, :attr:`~Mock.call_args_list`, :attr:`~Mock." -"mock_calls` y :attr:`~Mock.method_calls`. :func:`call`, también se puede " -"utilizar con :meth:`~Mock.assert_has_calls`." +":func:`call` es un objeto ayudante que puede usarse para hacer aserciones " +"simples, para comparar con :attr:`~Mock.call_args`, :attr:`~Mock." +"call_args_list`, :attr:`~Mock.mock_calls` y :attr:`~Mock.method_calls`. :func:" +"`call` y también se puede utilizar con :meth:`~Mock.assert_has_calls`." #: ../Doc/library/unittest.mock.rst:2240 msgid "" @@ -2667,9 +2708,9 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:2244 msgid "" "``call_list`` is particularly useful for making assertions on \"chained calls" -"\". A chained call is multiple calls on a single line of code. This results in " -"multiple entries in :attr:`~Mock.mock_calls` on a mock. Manually constructing " -"the sequence of calls can be tedious." +"\". A chained call is multiple calls on a single line of code. This results " +"in multiple entries in :attr:`~Mock.mock_calls` on a mock. Manually " +"constructing the sequence of calls can be tedious." msgstr "" "``call_list`` es particularmente útil para hacer aserciones sobre \"llamadas " "encadenadas\". Una llamada encadenada es varias llamadas en una sola línea de " @@ -2682,33 +2723,33 @@ msgid "" ":meth:`~call.call_list` can construct the sequence of calls from the same " "chained call:" msgstr "" -":meth:`~call.call_list` puede construir la secuencia de llamadas desde la misma " -"llamada encadenada:" +":meth:`~call.call_list` puede construir la secuencia de llamadas desde la " +"misma llamada encadenada:" #: ../Doc/library/unittest.mock.rst:2266 msgid "" "A ``call`` object is either a tuple of (positional args, keyword args) or " -"(name, positional args, keyword args) depending on how it was constructed. When " -"you construct them yourself this isn't particularly interesting, but the " +"(name, positional args, keyword args) depending on how it was constructed. " +"When you construct them yourself this isn't particularly interesting, but the " "``call`` objects that are in the :attr:`Mock.call_args`, :attr:`Mock." "call_args_list` and :attr:`Mock.mock_calls` attributes can be introspected to " "get at the individual arguments they contain." msgstr "" "Un objeto ``call``, dependiendo de cómo fuera construido, puede ser una tupla " -"de la forma (argumentos posicionales, argumentos por palabras clave) o bien de " -"la forma (nombre, argumentos posicionales, argumentos por palabras clave). Esto " -"no es particularmente interesante cuando los construyes por ti mismo, pero la " -"introspección de los objetos ``call`` que se encuentran en los atributos :attr:" -"`Mock.call_args`, :attr:`Mock.call_args_list` y :attr:`Mock.mock_calls` si " -"pueden ser de utilidad para para acceder a los argumentos individuales que " +"de la forma (argumentos posicionales, argumentos por palabras clave) o bien " +"de la forma (nombre, argumentos posicionales, argumentos por palabras clave). " +"Esto no es particularmente interesante cuando los construyes por ti mismo, " +"pero la introspección de los objetos ``call`` que conforman los atributos :" +"attr:`Mock.call_args`, :attr:`Mock.call_args_list` y :attr:`Mock.mock_calls` " +"si pueden ser de utilidad para para acceder a los argumentos individuales que " "contienen." #: ../Doc/library/unittest.mock.rst:2273 msgid "" -"The ``call`` objects in :attr:`Mock.call_args` and :attr:`Mock.call_args_list` " -"are two-tuples of (positional args, keyword args) whereas the ``call`` objects " -"in :attr:`Mock.mock_calls`, along with ones you construct yourself, are three-" -"tuples of (name, positional args, keyword args)." +"The ``call`` objects in :attr:`Mock.call_args` and :attr:`Mock." +"call_args_list` are two-tuples of (positional args, keyword args) whereas the " +"``call`` objects in :attr:`Mock.mock_calls`, along with ones you construct " +"yourself, are three-tuples of (name, positional args, keyword args)." msgstr "" "Los objetos ``call`` en :attr:`Mock.call_args` y :attr:`Mock.call_args_list` " "están conformados por dos tuplas (argumentos posicionales, argumentos por " @@ -2719,15 +2760,14 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:2278 msgid "" "You can use their \"tupleness\" to pull out the individual arguments for more " -"complex introspection and assertions. The positional arguments are a tuple (an " -"empty tuple if there are no positional arguments) and the keyword arguments are " -"a dictionary:" +"complex introspection and assertions. The positional arguments are a tuple " +"(an empty tuple if there are no positional arguments) and the keyword " +"arguments are a dictionary:" msgstr "" -"Puedes utilizar tu esta presentación mediante tuplas para obtener los " -"argumentos individuales con la finalidad de llevar a cabo una introspección más " -"compleja y para realizar aserciones. Los argumentos posicionales son una tupla " -"(vacía si no hay argumentos posicionales) y los argumentos por palabra clave " -"son un diccionario:" +"Puedes utilizar esta presentación en forma de tuplas para obtener los " +"argumentos individuales, con la finalidad de llevar a cabo introspección y " +"aserciones más complejas. Los argumentos posicionales son una tupla (vacía si " +"no hay ninguno) y los argumentos por palabra clave son un diccionario:" #: ../Doc/library/unittest.mock.rst:2311 msgid "create_autospec" @@ -2738,7 +2778,7 @@ msgid "" "Create a mock object using another object as a spec. Attributes on the mock " "will use the corresponding attribute on the *spec* object as their spec." msgstr "" -"Crea un nuevo objeto simulado utilizando otro objeto (*spec*) como una " +"Crea un nuevo objeto simulado utilizando otro objeto (*spec*) como " "especificación. Los atributos del objeto simulado utilizarán el atributo " "correspondiente del objeto *spec* como su especificación." @@ -2752,16 +2792,16 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:2322 msgid "" -"If *spec_set* is ``True`` then attempting to set attributes that don't exist on " -"the spec object will raise an :exc:`AttributeError`." +"If *spec_set* is ``True`` then attempting to set attributes that don't exist " +"on the spec object will raise an :exc:`AttributeError`." msgstr "" -"Si es *spec_set* es ``True``, tratar de establecer atributos que no existen en " -"el objeto especificado lanzará una excepción :exc:`AttributeError`." +"Si es *spec_set* es ``True``, tratar de establecer atributos que no existen " +"en el objeto especificado lanzará una excepción :exc:`AttributeError`." #: ../Doc/library/unittest.mock.rst:2325 msgid "" -"If a class is used as a spec then the return value of the mock (the instance of " -"the class) will have the same spec. You can use a class as the spec for an " +"If a class is used as a spec then the return value of the mock (the instance " +"of the class) will have the same spec. You can use a class as the spec for an " "instance object by passing ``instance=True``. The returned mock will only be " "callable if instances of the mock are callable." msgstr "" @@ -2773,11 +2813,11 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:2330 msgid "" -":func:`create_autospec` also takes arbitrary keyword arguments that are passed " -"to the constructor of the created mock." +":func:`create_autospec` also takes arbitrary keyword arguments that are " +"passed to the constructor of the created mock." msgstr "" -":func:`create_autospec` también acepta argumentos por palabra clave arbitrarios " -"que son pasados al constructor del objeto simulado creado." +":func:`create_autospec` también acepta argumentos por palabra clave " +"arbitrarios, que son pasados al constructor del objeto simulado creado." #: ../Doc/library/unittest.mock.rst:2333 msgid "" @@ -2807,10 +2847,10 @@ msgid "" "them individually out of :attr:`~Mock.call_args` and make more complex " "assertions on them." msgstr "" -"A veces puede que necesites hacer aserciones sobre *algunos* de los argumentos " -"de una llamada al objeto simulado, pero sin preocuparte por el resto, o puede " -"que quieras hacer uso de ellos de forma individual fuera de :attr:`~Mock." -"call_args` y hacer aserciones más complejas con ellos." +"A veces puede que necesites hacer aserciones sobre *algunos* de los " +"argumentos de una llamada al objeto simulado, pero sin preocuparte por el " +"resto, o puede que quieras hacer uso de ellos de forma individual fuera de :" +"attr:`~Mock.call_args` y hacer aserciones más complejas con ellos." #: ../Doc/library/unittest.mock.rst:2353 msgid "" @@ -2819,7 +2859,7 @@ msgid "" "assert_called_once_with` will then succeed no matter what was passed in." msgstr "" "Para ignorar ciertos argumentos puedes pasar objetos que se comparan como " -"iguales con *cualquier cosa*. En ese caso, las llamadas a :meth:`~Mock." +"iguales con *cualquier cosa*. En este caso, las llamadas a :meth:`~Mock." "assert_called_with` y :meth:`~Mock.assert_called_once_with` tendrán éxito sin " "importar lo que se haya pasado realmente." @@ -2829,7 +2869,7 @@ msgid "" "mock_calls`:" msgstr "" ":data:`ANY` también se puede utilizar en las comparaciones con las listas de " -"llamadas como :attr:`~Mock.mock_calls`:" +"llamadas, como :attr:`~Mock.mock_calls`:" #: ../Doc/library/unittest.mock.rst:2375 msgid "FILTER_DIR" @@ -2844,25 +2884,26 @@ msgid "" "diagnostic purposes, then set ``mock.FILTER_DIR = False``." msgstr "" ":data:`FILTER_DIR` es una variable definida a nivel de módulo que controla la " -"forma en la que los objetos simulados responden a :func:`dir` (sólo para Python " -"2.6 y en adelante). El valor predeterminado es ``True``, que utiliza el " -"filtrado descrito a continuación, con la finalidad de mostrar solo los miembros " -"considerados como útiles. Si no te gusta este filtrado, o necesitas " -"desactivarlo con fines de diagnóstico, simplemente establece ``mock.FILTER_DIR " -"= False``." +"forma en la que los objetos simulados responden a :func:`dir` (sólo para " +"Python 2.6 y en adelante). El valor predeterminado es ``True``, que utiliza " +"el filtrado descrito a continuación, con la finalidad de mostrar solo los " +"miembros considerados como útiles. Si no te gusta este filtrado, o necesitas " +"desactivarlo con fines de diagnóstico, simplemente establece ``mock." +"FILTER_DIR = False``." #: ../Doc/library/unittest.mock.rst:2385 msgid "" "With filtering on, ``dir(some_mock)`` shows only useful attributes and will " -"include any dynamically created attributes that wouldn't normally be shown. If " -"the mock was created with a *spec* (or *autospec* of course) then all the " -"attributes from the original are shown, even if they haven't been accessed yet:" +"include any dynamically created attributes that wouldn't normally be shown. " +"If the mock was created with a *spec* (or *autospec* of course) then all the " +"attributes from the original are shown, even if they haven't been accessed " +"yet:" msgstr "" "Con el filtrado activado, ``dir(some_mock)`` mostrará solo atributos útiles y " -"además incluirá cualquier atributo creado dinámicamente, que normalmente no se " -"mostraría. Si el objeto simulado fue creado con un *spec* (o *autospec*) se " -"muestran todos los atributos del objeto original, incluso si no se ha accedido " -"a ellos todavía:" +"además incluirá cualquier atributo creado dinámicamente, que normalmente no " +"se mostraría. Si el objeto simulado fue creado con un *spec* (o *autospec*) " +"se muestran todos los atributos del objeto original, incluso si no se ha " +"accedido a ellos todavía:" #: ../Doc/library/unittest.mock.rst:2412 msgid "" @@ -2874,15 +2915,15 @@ msgid "" msgstr "" "Muchos de los atributos con subrayado y doble subrayado no muy útiles " "(atributos privados de :class:`Mock` y no del objeto real que se está " -"simulando) se han filtrado del resultado de llamar a :func:`dir` en un :class:" -"`Mock`. Si no te gusta este comportamiento, puedes desactivarlo estableciendo " -"el modificador a nivel de módulo :data:`FILTER_DIR`:" +"simulando) se han filtrado del resultado de llamar a :func:`dir` en un " +"objeto :class:`Mock`. Si no te gusta este comportamiento, puedes desactivarlo " +"estableciendo el modificador a nivel de módulo :data:`FILTER_DIR`:" #: ../Doc/library/unittest.mock.rst:2433 msgid "" "Alternatively you can just use ``vars(my_mock)`` (instance members) and " -"``dir(type(my_mock))`` (type members) to bypass the filtering irrespective of :" -"data:`mock.FILTER_DIR`." +"``dir(type(my_mock))`` (type members) to bypass the filtering irrespective " +"of :data:`mock.FILTER_DIR`." msgstr "" "Como alternativa, puedes usar ``vars(my_mock)`` (miembros de instancia) y " "``dir(type(my_mock))`` (miembros de tipo) para omitir el filtrado con " @@ -2894,22 +2935,22 @@ msgstr "mock_open" #: ../Doc/library/unittest.mock.rst:2443 msgid "" -"A helper function to create a mock to replace the use of :func:`open`. It works " -"for :func:`open` called directly or used as a context manager." +"A helper function to create a mock to replace the use of :func:`open`. It " +"works for :func:`open` called directly or used as a context manager." msgstr "" -"Una función auxiliar para un objeto simulado con la finalidad de reemplazar el " -"uso de :func:`open`. Funciona tanto para la llamada directa a :func:`open` como " -"utilizado como administrador de contexto." +"Una función auxiliar para un objeto simulado con la finalidad de reemplazar " +"el uso de :func:`open`. Funciona tanto para la llamada directa a :func:`open` " +"como utilizado como gestor de contexto." #: ../Doc/library/unittest.mock.rst:2446 msgid "" -"The *mock* argument is the mock object to configure. If ``None`` (the default) " -"then a :class:`MagicMock` will be created for you, with the API limited to " -"methods or attributes available on standard file handles." +"The *mock* argument is the mock object to configure. If ``None`` (the " +"default) then a :class:`MagicMock` will be created for you, with the API " +"limited to methods or attributes available on standard file handles." msgstr "" "El argumento *mock* es el objeto simulado a configurar. Si es ``None`` (por " -"defecto) un objeto :class:`MagicMock` se creará para ti, con la API limitada a " -"métodos o atributos disponibles en los gestores de fichero estándares." +"defecto) un objeto :class:`MagicMock` se creará para ti, con la API limitada " +"a métodos o atributos disponibles en los gestores de fichero estándares." #: ../Doc/library/unittest.mock.rst:2450 msgid "" @@ -2918,31 +2959,31 @@ msgid "" "return. Calls to those methods will take data from *read_data* until it is " "depleted. The mock of these methods is pretty simplistic: every time the " "*mock* is called, the *read_data* is rewound to the start. If you need more " -"control over the data that you are feeding to the tested code you will need to " -"customize this mock for yourself. When that is insufficient, one of the in-" -"memory filesystem packages on `PyPI `_ can offer a realistic " -"filesystem for testing." +"control over the data that you are feeding to the tested code you will need " +"to customize this mock for yourself. When that is insufficient, one of the " +"in-memory filesystem packages on `PyPI `_ can offer a " +"realistic filesystem for testing." msgstr "" "*read_data* es una cadena de caracteres para los métodos :meth:`~io.IOBase." -"read`, :meth:`~io.IOBase.readline` y :meth:`~io.IOBase.readlines` del gestor de " -"fichero a retornar. Las llamadas a los métodos tomarán datos de *read_data* " -"hasta que se agote. El objeto simulado de estos métodos es bastante simple: " -"cada vez que el *mock* se llama, *read_data* se rebobina hasta el principio. Si " -"necesitas más control sobre los datos que estás proporcionando al código de " -"prueba tendrás que personalizar el objeto simulado. Cuando eso no sea " -"suficiente, alguno de los paquetes que implementan sistemas de archivos en " -"memoria disponible en `PyPI `_ puede ofrecer un sistema de " -"archivos realista para usar en las pruebas." +"read`, :meth:`~io.IOBase.readline` y :meth:`~io.IOBase.readlines` del gestor " +"de fichero a retornar. Las llamadas a los métodos tomarán datos de " +"*read_data* hasta que se agote. El objeto simulado de estos métodos es " +"bastante simple: cada vez que el *mock* se llama, *read_data* se rebobina " +"hasta el principio. Si necesitas más control sobre los datos que estás " +"proporcionando al código de prueba tendrás que personalizar el objeto " +"simulado. Cuando eso no sea suficiente, alguno de los paquetes que " +"implementan sistemas de archivos en memoria disponible en `PyPI `_ puede ofrecer un sistema de archivos realista para usar en las pruebas." #: ../Doc/library/unittest.mock.rst:2460 msgid "" -"Added :meth:`~io.IOBase.readline` and :meth:`~io.IOBase.readlines` support. The " -"mock of :meth:`~io.IOBase.read` changed to consume *read_data* rather than " -"returning it on each call." +"Added :meth:`~io.IOBase.readline` and :meth:`~io.IOBase.readlines` support. " +"The mock of :meth:`~io.IOBase.read` changed to consume *read_data* rather " +"than returning it on each call." msgstr "" "Añadido soporte para :meth:`~io.IOBase.readline` y :meth:`~io.IOBase." "readlines`. El objeto simulado de :meth:`~io.IOBase.read` ahora consume datos " -"de *read_data* en lugar de retornarlo en cada llamada." +"de *read_data*, en lugar de retornarlo en cada llamada." #: ../Doc/library/unittest.mock.rst:2465 msgid "*read_data* is now reset on each call to the *mock*." @@ -2961,27 +3002,27 @@ msgid "" "Using :func:`open` as a context manager is a great way to ensure your file " "handles are closed properly and is becoming common::" msgstr "" -"Usar :func:`open` como un administrador de contexto es una buena manera de " -"asegurarse de que los gestores de fichero se cierran correctamente al terminar " -"y se está convirtiendo en una práctica común:" +"Usar :func:`open` como gestor de contexto es una buena manera de asegurarse " +"de que los gestores de archivos se cierren correctamente al terminar y se " +"está convirtiendo en una práctica común:" #: ../Doc/library/unittest.mock.rst:2478 msgid "" "The issue is that even if you mock out the call to :func:`open` it is the " -"*returned object* that is used as a context manager (and has :meth:`__enter__` " -"and :meth:`__exit__` called)." +"*returned object* that is used as a context manager (and has :meth:" +"`__enter__` and :meth:`__exit__` called)." msgstr "" -"El problema es que incluso si simulas la llamada a :func:`open` es el *objeto " -"retornado* el que se utiliza como administrador de contexto (lo que conlleva " -"que sus métodos :meth:`__enter__` y :meth:`__exit__` han sido llamados)." +"El problema es que, incluso si simulas la llamada a :func:`open`, es el " +"*objeto retornado* el que se utiliza como gestor de contexto (lo que conlleva " +"que sus métodos :meth:`__enter__` y :meth:`__exit__` son llamados)." #: ../Doc/library/unittest.mock.rst:2482 msgid "" -"Mocking context managers with a :class:`MagicMock` is common enough and fiddly " -"enough that a helper function is useful. ::" +"Mocking context managers with a :class:`MagicMock` is common enough and " +"fiddly enough that a helper function is useful. ::" msgstr "" -"Simular administradores de contexto con un :class:`MagicMock` es lo " -"suficientemente común y complicado como para que una función auxiliar sea útil:" +"Simular gestores de contexto con un :class:`MagicMock` es lo suficientemente " +"común y complicado como para que una función auxiliar sea útil:" #: ../Doc/library/unittest.mock.rst:2499 msgid "And for reading files::" @@ -2996,13 +3037,13 @@ msgid "" "Autospeccing is based on the existing :attr:`spec` feature of mock. It limits " "the api of mocks to the api of an original object (the spec), but it is " "recursive (implemented lazily) so that attributes of mocks only have the same " -"api as the attributes of the spec. In addition mocked functions / methods have " -"the same call signature as the original so they raise a :exc:`TypeError` if " -"they are called incorrectly." +"api as the attributes of the spec. In addition mocked functions / methods " +"have the same call signature as the original so they raise a :exc:`TypeError` " +"if they are called incorrectly." msgstr "" -"La autoespecificación se basa en la característica :attr:`spec` ya existente en " -"el objeto simulado. Limita la API de los objetos simulados a la API del objeto " -"original (la especificación), pero es recursiva (implementada de forma " +"La autoespecificación se basa en la característica :attr:`spec` ya existente " +"en el objeto simulado. Limita la API de los objetos simulados a la API del " +"objeto original (la especificación), pero es recursiva (implementada de forma " "perezosa), de modo que los atributos del objeto simulado sólo tienen la misma " "API que los atributos de la especificación. Además, las funciones / métodos " "simuladas tienen la misma firma de llamada que la original y lanzan una " @@ -3021,10 +3062,10 @@ msgid "" "flaws is specific to the :class:`Mock` api and the other is a more general " "problem with using mock objects." msgstr "" -":class:`Mock` es un objeto muy potente y flexible, pero adolece de dos defectos " -"cuando se utiliza para simular objetos de un sistema bajo prueba. Uno de estos " -"defectos es específico de la API :class:`Mock` y el otro es un problema más " -"genérico referente al uso de objetos simulados." +":class:`Mock` es un objeto muy potente y flexible, pero adolece de dos " +"defectos cuando se utiliza para simular objetos de un sistema bajo prueba. " +"Uno de estos defectos es específico de la API de :class:`Mock` y el otro es " +"un problema más genérico referente al uso de objetos simulados." #: ../Doc/library/unittest.mock.rst:2528 msgid "" @@ -3038,45 +3079,47 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:2541 msgid "" -"Because mocks auto-create attributes on demand, and allow you to call them with " -"arbitrary arguments, if you misspell one of these assert methods then your " -"assertion is gone:" +"Because mocks auto-create attributes on demand, and allow you to call them " +"with arbitrary arguments, if you misspell one of these assert methods then " +"your assertion is gone:" msgstr "" -"Debido a que el objeto simulado crea automáticamente atributos según demanda y " -"permiten que se les llame con argumentos arbitrarios, si escribes mal uno de " -"estos métodos de aserción, la utilidad de esa aserción desaparece:" +"Debido a que los objetos simulados crean automáticamente atributos según " +"demanda y además permiten que se les llame con argumentos arbitrarios, si " +"escribes mal uno de estos métodos de aserción, la utilidad de esa aserción " +"desaparece:" #: ../Doc/library/unittest.mock.rst:2551 msgid "Your tests can pass silently and incorrectly because of the typo." msgstr "" -"Tus pruebas pueden pasar silenciosamente y de forma incorrecta debido al error " -"tipográfico." +"Tus pruebas pueden pasar silenciosamente y de forma incorrecta debido al " +"error tipográfico." #: ../Doc/library/unittest.mock.rst:2553 msgid "" -"The second issue is more general to mocking. If you refactor some of your code, " -"rename members and so on, any tests for code that is still using the *old api* " -"but uses mocks instead of the real objects will still pass. This means your " -"tests can all pass even though your code is broken." +"The second issue is more general to mocking. If you refactor some of your " +"code, rename members and so on, any tests for code that is still using the " +"*old api* but uses mocks instead of the real objects will still pass. This " +"means your tests can all pass even though your code is broken." msgstr "" "El segundo problema es algo más general en las simulaciones. Si refactorizas " "parte de tu código, cambias el nombre de los miembros, etc., las pruebas para " -"el código que siguen utilizando la *antigua API* pero utilizan objetos " -"simulados en lugar de los objetos reales todavía pasarán las pruebas. Esto " -"significa que tus pruebas pueden validarlo todo sin problemas a pesar de que el " -"código esté roto." +"el código que siguen utilizando la *antigua API*, pero utilizan objetos " +"simulados en lugar de los objetos reales, todavía pasarán las pruebas. Esto " +"significa que tus pruebas pueden validarlo todo sin problemas, a pesar de que " +"el código esté roto." #: ../Doc/library/unittest.mock.rst:2558 msgid "" -"Note that this is another reason why you need integration tests as well as unit " -"tests. Testing everything in isolation is all fine and dandy, but if you don't " -"test how your units are \"wired together\" there is still lots of room for bugs " -"that tests might have caught." +"Note that this is another reason why you need integration tests as well as " +"unit tests. Testing everything in isolation is all fine and dandy, but if you " +"don't test how your units are \"wired together\" there is still lots of room " +"for bugs that tests might have caught." msgstr "" -"Ten en cuenta que esta es otra razón por la que necesita pruebas de integración " -"además de pruebas unitarias. Probar todo de forma aislada está muy bien, pero " -"si no pruebas cómo están \"conectadas entre sí\" tus unidades, todavía hay " -"mucho espacio para errores que las pruebas deberían haber detectado." +"Ten en cuenta que esta es otra razón por la que necesitas pruebas de " +"integración además de pruebas unitarias. Probar todo de forma aislada está " +"muy bien, pero si no pruebas cómo están \"conectadas entre sí\" tus unidades, " +"todavía hay mucho espacio para errores que las pruebas deberían haber " +"detectado." #: ../Doc/library/unittest.mock.rst:2563 msgid "" @@ -3085,14 +3128,14 @@ msgid "" "access attributes on the mock that exist on the real class:" msgstr "" ":mod:`mock` ya proporciona una característica para ayudar con esto, llamada " -"especificación. Si se utiliza una clase o instancia como atributo :attr:`spec` " -"de un objeto simulado, entonces solo puedes acceder a los atributos del mismo " -"que existe en la clase real:" +"especificación. Si se utiliza una clase o instancia como atributo :attr:" +"`spec` de un objeto simulado, entonces solo puedes acceder a los atributos " +"del mismo que existe en la clase real:" #: ../Doc/library/unittest.mock.rst:2574 msgid "" -"The spec only applies to the mock itself, so we still have the same issue with " -"any methods on the mock:" +"The spec only applies to the mock itself, so we still have the same issue " +"with any methods on the mock:" msgstr "" "La especificación sólo se aplica al propio objeto simulado, por lo que aún " "tenemos el mismo problema con cualquiera de los métodos del mismo:" @@ -3100,34 +3143,34 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:2583 msgid "" "Auto-speccing solves this problem. You can either pass ``autospec=True`` to :" -"func:`patch` / :func:`patch.object` or use the :func:`create_autospec` function " -"to create a mock with a spec. If you use the ``autospec=True`` argument to :" -"func:`patch` then the object that is being replaced will be used as the spec " -"object. Because the speccing is done \"lazily\" (the spec is created as " -"attributes on the mock are accessed) you can use it with very complex or deeply " -"nested objects (like modules that import modules that import modules) without a " -"big performance hit." -msgstr "" -"La autoespecificación resuelve este problema. Puedes pasar ``autospec=True`` a :" -"func:`patch` / :func:`patch.object` o utilizar la función :func:" +"func:`patch` / :func:`patch.object` or use the :func:`create_autospec` " +"function to create a mock with a spec. If you use the ``autospec=True`` " +"argument to :func:`patch` then the object that is being replaced will be used " +"as the spec object. Because the speccing is done \"lazily\" (the spec is " +"created as attributes on the mock are accessed) you can use it with very " +"complex or deeply nested objects (like modules that import modules that " +"import modules) without a big performance hit." +msgstr "" +"La autoespecificación resuelve este problema. Puedes pasar ``autospec=True`` " +"a :func:`patch` / :func:`patch.object` o utilizar la función :func:" "`create_autospec` para crear un objeto simulado con una especificación. Si " -"utilizas el argumento ``autospec=True`` de :func:`patch` el objeto que se va a " -"reemplazar se utiliza como objeto de especificación. Debido a que la " +"utilizas el argumento ``autospec=True`` de :func:`patch`, el objeto que se va " +"a reemplazar se utiliza como objeto de especificación. Debido a que la " "especificación se hace \"perezosamente\" (la especificación se crea en el " -"instante en el que se accede a los atributos en la maqueta, no antes) se puede " -"utilizar con objetos muy complejos o anidadas (como módulos que importan " -"módulos que, a su vez, importan otros módulos) sin un gran impacto en el " -"rendimiento." +"instante en el que se accede a los atributos del objeto simulado, no antes), " +"se puede utilizar con objetos muy complejos o anidadas (como módulos que " +"importan módulos que, a su vez, importan otros módulos) sin un gran impacto " +"en el rendimiento." #: ../Doc/library/unittest.mock.rst:2592 msgid "Here's an example of it in use::" -msgstr "He aquí un ejemplo de ello en uso:" +msgstr "He aquí un ejemplo de ello en acción:" #: ../Doc/library/unittest.mock.rst:2602 msgid "" -"You can see that :class:`request.Request` has a spec. :class:`request.Request` " -"takes two arguments in the constructor (one of which is *self*). Here's what " -"happens if we try to call it incorrectly::" +"You can see that :class:`request.Request` has a spec. :class:`request." +"Request` takes two arguments in the constructor (one of which is *self*). " +"Here's what happens if we try to call it incorrectly::" msgstr "" "Se puede ver que :class:`request.Request` tiene una especificación. :class:" "`request.Request` toma dos argumentos en el constructor (uno de los cuales es " @@ -3135,28 +3178,28 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:2611 msgid "" -"The spec also applies to instantiated classes (i.e. the return value of specced " -"mocks)::" +"The spec also applies to instantiated classes (i.e. the return value of " +"specced mocks)::" msgstr "" "La especificación también se aplica a las clases instanciadas (es decir, el " "valor de retorno de los objetos simulados especificados):" #: ../Doc/library/unittest.mock.rst:2618 msgid "" -":class:`Request` objects are not callable, so the return value of instantiating " -"our mocked out :class:`request.Request` is a non-callable mock. With the spec " -"in place any typos in our asserts will raise the correct error::" +":class:`Request` objects are not callable, so the return value of " +"instantiating our mocked out :class:`request.Request` is a non-callable mock. " +"With the spec in place any typos in our asserts will raise the correct error::" msgstr "" -"Los objetos de la clase :class:`Request` no son invocables, por lo que el valor " -"de retorno de una instancia de nuestro objeto simulado de :class:`request." -"Request` no es invocable. Con la especificación, en cambio, cualquier error " -"tipográfico en nuestras afirmaciones generará el error correcto:" +"Los objetos de la clase :class:`Request` no son invocables, por lo que el " +"valor de retorno de una instancia de nuestro objeto simulado de :class:" +"`request.Request` no es invocable. Con la especificación, en cambio, " +"cualquier error tipográfico en nuestras aserciones generará el error correcto:" #: ../Doc/library/unittest.mock.rst:2630 msgid "" -"In many cases you will just be able to add ``autospec=True`` to your existing :" -"func:`patch` calls and then be protected against bugs due to typos and api " -"changes." +"In many cases you will just be able to add ``autospec=True`` to your " +"existing :func:`patch` calls and then be protected against bugs due to typos " +"and api changes." msgstr "" "En muchos casos, podrás simplemente añadir ``autospec=True`` a tus llamadas :" "func:`patch` existentes y así estar protegido contra errores tipográficos y " @@ -3173,25 +3216,25 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:2642 msgid "" -"This isn't without caveats and limitations however, which is why it is not the " -"default behaviour. In order to know what attributes are available on the spec " -"object, autospec has to introspect (access attributes) the spec. As you " +"This isn't without caveats and limitations however, which is why it is not " +"the default behaviour. In order to know what attributes are available on the " +"spec object, autospec has to introspect (access attributes) the spec. As you " "traverse attributes on the mock a corresponding traversal of the original " "object is happening under the hood. If any of your specced objects have " "properties or descriptors that can trigger code execution then you may not be " "able to use autospec. On the other hand it is much better to design your " "objects so that introspection is safe [#]_." msgstr "" -"Sin embargo, este no es el comportamiento predeterminado, ya que no está exento " -"de advertencias y restricciones. Con el fin de conocer que atributos están " -"disponibles en el objeto especificado, autospec tiene que hacer uso de " +"Sin embargo, este no es el comportamiento predeterminado, ya que no está " +"exento de advertencias y restricciones. Con el fin de conocer que atributos " +"están disponibles en el objeto especificado, autospec tiene que hacer uso de " "introspección sobre la especificación (acceder a los atributos). A medida que " "recorres los atributos en el objeto simulado, se produce paralelamente y de " "forma soterrada un recorrido del objeto original. Si alguno de tus objetos " "especificados tienen propiedades o descriptores que puedan desencadenar la " "ejecución de código, quizás no deberías utilizar la autoespecificación. De " "todas formas, es siempre mucho mejor diseñar tus objetos de modo que la " -"introspección sea segura [#] _." +"introspección sea segura [#]_." #: ../Doc/library/unittest.mock.rst:2651 msgid "" @@ -3202,20 +3245,21 @@ msgid "" msgstr "" "Un problema más serio es que es común que los atributos de instancia sean " "creados en el método :meth:`__init__` y que no existan a nivel de clase. " -"*autospec* no puede tener conocimiento de ningún atributo creado dinámicamente, " -"por lo que restringe la API a atributos visibles:" +"*autospec* no puede tener conocimiento de ningún atributo creado " +"dinámicamente, por lo que restringe la API a atributos visibles:" #: ../Doc/library/unittest.mock.rst:2668 msgid "" -"There are a few different ways of resolving this problem. The easiest, but not " -"necessarily the least annoying, way is to simply set the required attributes on " -"the mock after creation. Just because *autospec* doesn't allow you to fetch " -"attributes that don't exist on the spec it doesn't prevent you setting them::" +"There are a few different ways of resolving this problem. The easiest, but " +"not necessarily the least annoying, way is to simply set the required " +"attributes on the mock after creation. Just because *autospec* doesn't allow " +"you to fetch attributes that don't exist on the spec it doesn't prevent you " +"setting them::" msgstr "" -"Hay diferentes formas de resolver este problema. La forma más sencilla, pero no " -"necesariamente la menos molesta, es simplemente establecer los atributos " -"necesarios en el objeto simulado después de la creación del mismo. El hecho de " -"que *autospec* no te permita buscar atributos que no existen en la " +"Hay diferentes formas de resolver este problema. La forma más sencilla, pero " +"no necesariamente la menos molesta, es simplemente establecer los atributos " +"necesarios en el objeto simulado después de la creación del mismo. El hecho " +"de que *autospec* no te permita buscar atributos que no existen en la " "especificación no impide que los establezcas manualmente después:" #: ../Doc/library/unittest.mock.rst:2679 @@ -3226,21 +3270,21 @@ msgid "" "this particular scenario:" msgstr "" "Existe una versión más agresiva de *spec* y *autospec* que impide establecer " -"atributos inexistentes. Esto es útil si deseas asegurarte de que tu código solo " -"*establece* atributos válidos, pero obviamente evitando este escenario en " -"particular:" +"atributos inexistentes. Esto es útil si deseas asegurarte de que tu código " +"solo *establece* atributos válidos, pero obviamente evitando este escenario " +"en particular:" #: ../Doc/library/unittest.mock.rst:2692 msgid "" "Probably the best way of solving the problem is to add class attributes as " -"default values for instance members initialised in :meth:`__init__`. Note that " -"if you are only setting default attributes in :meth:`__init__` then providing " -"them via class attributes (shared between instances of course) is faster too. e." -"g." +"default values for instance members initialised in :meth:`__init__`. Note " +"that if you are only setting default attributes in :meth:`__init__` then " +"providing them via class attributes (shared between instances of course) is " +"faster too. e.g." msgstr "" "Probablemente la mejor manera de resolver el problema es añadir atributos de " -"clase como valores por defecto para los miembros de instancia inicializados en " -"el método :meth:`__init__`. Ten en cuenta que si sólo estás estableciendo " +"clase como valores por defecto para los miembros de instancia inicializados " +"en el método :meth:`__init__`. Ten en cuenta que, si sólo estás estableciendo " "atributos predeterminados en :meth:`__init__`, proporcionarlos a través de " "atributos de clase (que , por supuesto, son compartidos entre instancias) " "también es más rápido." @@ -3248,50 +3292,52 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:2702 msgid "" "This brings up another issue. It is relatively common to provide a default " -"value of ``None`` for members that will later be an object of a different type. " -"``None`` would be useless as a spec because it wouldn't let you access *any* " -"attributes or methods on it. As ``None`` is *never* going to be useful as a " -"spec, and probably indicates a member that will normally of some other type, " -"autospec doesn't use a spec for members that are set to ``None``. These will " -"just be ordinary mocks (well - MagicMocks):" +"value of ``None`` for members that will later be an object of a different " +"type. ``None`` would be useless as a spec because it wouldn't let you access " +"*any* attributes or methods on it. As ``None`` is *never* going to be useful " +"as a spec, and probably indicates a member that will normally of some other " +"type, autospec doesn't use a spec for members that are set to ``None``. These " +"will just be ordinary mocks (well - MagicMocks):" msgstr "" "Esto nos plantea otro problema. Es relativamente común proporcionar un valor " -"predeterminado de ``None`` para los miembros que posteriormente se convertirán " -"en objetos de un tipo diferente. ``None`` es inútil como especificación dado " -"que no permite acceder a *ningún* atributo o método. Como ``None`` *nunca* será " -"útil como especificación, y probablemente indica un miembro que normalmente " -"será de algún otro tipo, la autoespecificación no usa una especificación para " -"aquellos miembros configurados con ``None`` como valor. Estos serán simplemente " -"objetos simulados ordinarios (MagicMocks en realidad):" +"predeterminado de ``None`` para los miembros que posteriormente se " +"convertirán en objetos de un tipo diferente. ``None`` es inútil como " +"especificación dado que no permite acceder a *ningún* atributo o método. Como " +"``None`` *nunca* será útil como especificación, y probablemente indica un " +"miembro que normalmente será de algún otro tipo en el futuro, la " +"autoespecificación no usa una especificación para aquellos miembros " +"configurados con ``None`` como valor. Estos serán simplemente objetos " +"simulados ordinarios (MagicMocks en realidad):" #: ../Doc/library/unittest.mock.rst:2717 msgid "" -"If modifying your production classes to add defaults isn't to your liking then " -"there are more options. One of these is simply to use an instance as the spec " -"rather than the class. The other is to create a subclass of the production " -"class and add the defaults to the subclass without affecting the production " -"class. Both of these require you to use an alternative object as the spec. " -"Thankfully :func:`patch` supports this - you can simply pass the alternative " -"object as the *autospec* argument::" +"If modifying your production classes to add defaults isn't to your liking " +"then there are more options. One of these is simply to use an instance as the " +"spec rather than the class. The other is to create a subclass of the " +"production class and add the defaults to the subclass without affecting the " +"production class. Both of these require you to use an alternative object as " +"the spec. Thankfully :func:`patch` supports this - you can simply pass the " +"alternative object as the *autospec* argument::" msgstr "" "Si modificar tus clases en producción para agregar valores predeterminados no " "es de tu agrado, dispones de otras opciones. Una de ellas es simplemente usar " "una instancia como especificación en lugar de la clase. La otra es crear una " "subclase de la clase en producción y agregar los valores predeterminados a la " -"subclase sin afectar la clase en producción. Ambas alternativas requieren que " -"uses un objeto alternativo como especificación. Afortunadamente :func:`patch` " -"admite esto; simplemente puedes pasar el objeto alternativo mediante el " -"argumento *autospec*:" +"subclase, sin afectar a la clase en producción. Ambas alternativas requieren " +"que uses un objeto alternativo como especificación. Afortunadamente :func:" +"`patch` admite esto, simplemente tienes que pasar el objeto alternativo " +"mediante el argumento *autospec*:" #: ../Doc/library/unittest.mock.rst:2738 msgid "" -"This only applies to classes or already instantiated objects. Calling a mocked " -"class to create a mock instance *does not* create a real instance. It is only " -"attribute lookups - along with calls to :func:`dir` - that are done." +"This only applies to classes or already instantiated objects. Calling a " +"mocked class to create a mock instance *does not* create a real instance. It " +"is only attribute lookups - along with calls to :func:`dir` - that are done." msgstr "" -"Esto sólo se aplica a las clases u objetos ya instanciados. Llamar a una clase " -"simulada para crear una instancia simulada *no* crea una instancia real. Solo " -"se llevan a cabo las búsqueda de atributos (mediante llamadas a :func:`dir`)." +"Esto sólo se aplica a las clases u objetos ya instanciados. Llamar a una " +"clase simulada para crear una instancia simulada *no* crea una instancia " +"real. Solo se llevan a cabo las búsqueda de atributos (mediante llamadas a :" +"func:`dir`)." #: ../Doc/library/unittest.mock.rst:2743 msgid "Sealing mocks" @@ -3304,14 +3350,14 @@ msgid "" "recursively." msgstr "" "Seal desactivará la creación automática de objetos simulados al acceder a un " -"atributo del objeto simulado que está siendo sellado o cualquiera de sus " +"atributo del objeto simulado que está siendo sellado, o a cualquiera de sus " "atributos que ya sean objetos simulados de forma recursiva." #: ../Doc/library/unittest.mock.rst:2755 msgid "" "If a mock instance with a name or a spec is assigned to an attribute it won't " -"be considered in the sealing chain. This allows one to prevent seal from fixing " -"part of the mock object. ::" +"be considered in the sealing chain. This allows one to prevent seal from " +"fixing part of the mock object. ::" msgstr "" "Si una instancia simulada con un nombre o una especificación es asignada a un " "atributo no será considerada en la cadena de sellado. Esto permite evitar que " From f174f2e9b178f50483f1326eb73443f307f292ee Mon Sep 17 00:00:00 2001 From: fjsevilla-dev Date: Sun, 4 Oct 2020 00:20:11 +0200 Subject: [PATCH 03/10] =?UTF-8?q?Correcci=C3=B3n=20de=20errores=20de=20Tra?= =?UTF-8?q?vis?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dictionaries/library_unittest.mock.txt | 1 + library/unittest.mock.po | 1101 ++++++++++++------------ 2 files changed, 564 insertions(+), 538 deletions(-) diff --git a/dictionaries/library_unittest.mock.txt b/dictionaries/library_unittest.mock.txt index 7a7aeb7b41..d8d1bf5f3a 100644 --- a/dictionaries/library_unittest.mock.txt +++ b/dictionaries/library_unittest.mock.txt @@ -1,3 +1,4 @@ +adjuntarlos Aserta asertar autospec diff --git a/library/unittest.mock.po b/library/unittest.mock.po index 71ed369998..bdb17f4d8a 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -33,34 +33,35 @@ msgstr "**Source code:** :source:`Lib/unittest/mock.py`" #: ../Doc/library/unittest.mock.rst:17 msgid "" ":mod:`unittest.mock` is a library for testing in Python. It allows you to " -"replace parts of your system under test with mock objects and make assertions " -"about how they have been used." +"replace parts of your system under test with mock objects and make " +"assertions about how they have been used." msgstr "" -":mod:`unittest.mock` es una biblioteca para pruebas de software en Python. Te " -"permite reemplazar partes del sistema bajo prueba con objetos simulados y " +":mod:`unittest.mock` es una biblioteca para pruebas de software en Python. " +"Te permite reemplazar partes del sistema bajo prueba con objetos simulados y " "hacer aserciones sobre cómo se han utilizado." #: ../Doc/library/unittest.mock.rst:21 msgid "" -":mod:`unittest.mock` provides a core :class:`Mock` class removing the need to " -"create a host of stubs throughout your test suite. After performing an " +":mod:`unittest.mock` provides a core :class:`Mock` class removing the need " +"to create a host of stubs throughout your test suite. After performing an " "action, you can make assertions about which methods / attributes were used " "and arguments they were called with. You can also specify return values and " "set needed attributes in the normal way." msgstr "" "El módulo :mod:`unittest.mock` proporciona una clase principal :class:`Mock` " "eliminando la necesidad de crear una gran cantidad de stubs en todo el " -"conjunto de pruebas. Después de realizar una determinada acción, puedes hacer " -"aserciones sobre qué métodos/atributos se usaron y los argumentos con los que " -"se llamaron. También puedes especificar valores de retorno y establecer los " -"atributos necesarios de la forma habitual." +"conjunto de pruebas. Después de realizar una determinada acción, puedes " +"hacer aserciones sobre qué métodos/atributos se usaron y los argumentos con " +"los que se llamaron. También puedes especificar valores de retorno y " +"establecer los atributos necesarios de la forma habitual." #: ../Doc/library/unittest.mock.rst:27 msgid "" "Additionally, mock provides a :func:`patch` decorator that handles patching " "module and class level attributes within the scope of a test, along with :" -"const:`sentinel` for creating unique objects. See the `quick guide`_ for some " -"examples of how to use :class:`Mock`, :class:`MagicMock` and :func:`patch`." +"const:`sentinel` for creating unique objects. See the `quick guide`_ for " +"some examples of how to use :class:`Mock`, :class:`MagicMock` and :func:" +"`patch`." msgstr "" "Además, mock proporciona un decorador :func:`patch` que puede manejar el " "parcheo de atributos a nivel de clase y de módulo dentro del ámbito de una " @@ -101,8 +102,8 @@ msgstr "" "Los objetos de las clases :class:`Mock` y :class:`MagicMock` van creando " "todos los atributos y métodos a medida que se accede a ellos y almacenan " "detalles de cómo se han utilizado. Puedes configurarlos para especificar " -"valores de retorno o limitar qué atributos están disponibles y posteriormente " -"hacer aserciones sobre cómo han sido utilizados:" +"valores de retorno o limitar qué atributos están disponibles y " +"posteriormente hacer aserciones sobre cómo han sido utilizados:" #: ../Doc/library/unittest.mock.rst:72 msgid "" @@ -122,8 +123,8 @@ msgstr "" "Existen muchas otras formas de configurar y controlar el comportamiento de " "Mock. Por ejemplo, el argumento *spec* configura el objeto simulado para que " "tome su especificación de otro objeto. Cualquier intento de acceder a " -"atributos o métodos en el objeto simulado que no existan en la especificación " -"fallará lanzando una excepción :exc:`AttributeError`." +"atributos o métodos en el objeto simulado que no existan en la " +"especificación fallará lanzando una excepción :exc:`AttributeError`." #: ../Doc/library/unittest.mock.rst:97 msgid "" @@ -156,9 +157,9 @@ msgid "" "they are looked up. This is normally straightforward, but for a quick guide " "read :ref:`where to patch `." msgstr "" -"Al usar :func:`patch` es importante que parchees los objetos en el espacio de " -"nombres donde son buscados. Esto normalmente es sencillo, pero para una guía " -"rápida, lee :ref:`dónde parchear `." +"Al usar :func:`patch` es importante que parchees los objetos en el espacio " +"de nombres donde son buscados. Esto normalmente es sencillo, pero para una " +"guía rápida, lee :ref:`dónde parchear `." #: ../Doc/library/unittest.mock.rst:125 msgid "" @@ -180,9 +181,9 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:146 msgid "" -"Mock supports the mocking of Python :ref:`magic methods `. The " -"easiest way of using magic methods is with the :class:`MagicMock` class. It " -"allows you to do things like:" +"Mock supports the mocking of Python :ref:`magic methods `. " +"The easiest way of using magic methods is with the :class:`MagicMock` class. " +"It allows you to do things like:" msgstr "" "Mock admite la simulación de los :ref:`métodos mágicos ` de " "Python. La forma más sencilla de utilizar métodos mágicos es mediante la " @@ -195,38 +196,38 @@ msgid "" "is just a Mock variant that has all of the magic methods pre-created for you " "(well, all the useful ones anyway)." msgstr "" -"Mock también permite asignar funciones (u otras instancias de Mock) a métodos " -"mágicos y se asegura de que serán llamadas de forma apropiada. La clase :" -"class:`MagicMock` es solo una variante de Mock con la diferencia de que tiene " -"todos los métodos mágicos previamente creados para ti (bueno, todos los que " -"son útiles)." +"Mock también permite asignar funciones (u otras instancias de Mock) a " +"métodos mágicos y se asegura de que serán llamadas de forma apropiada. La " +"clase :class:`MagicMock` es solo una variante de Mock con la diferencia de " +"que tiene todos los métodos mágicos previamente creados para ti (bueno, " +"todos los que son útiles)." #: ../Doc/library/unittest.mock.rst:161 msgid "" "The following is an example of using magic methods with the ordinary Mock " "class:" msgstr "" -"El siguiente es un ejemplo de uso de métodos mágicos utilizando la clase Mock " -"ordinaria:" +"El siguiente es un ejemplo de uso de métodos mágicos utilizando la clase " +"Mock ordinaria:" #: ../Doc/library/unittest.mock.rst:169 msgid "" "For ensuring that the mock objects in your tests have the same api as the " -"objects they are replacing, you can use :ref:`auto-speccing `. " -"Auto-speccing can be done through the *autospec* argument to patch, or the :" -"func:`create_autospec` function. Auto-speccing creates mock objects that have " -"the same attributes and methods as the objects they are replacing, and any " -"functions and methods (including constructors) have the same call signature " -"as the real object." +"objects they are replacing, you can use :ref:`auto-speccing `. Auto-speccing can be done through the *autospec* argument to " +"patch, or the :func:`create_autospec` function. Auto-speccing creates mock " +"objects that have the same attributes and methods as the objects they are " +"replacing, and any functions and methods (including constructors) have the " +"same call signature as the real object." msgstr "" "Para asegurarte de que los objetos simulados en tus pruebas tienen " -"exactamente la misma API que los objetos que están reemplazando, puedes usar :" -"ref:`autoespecificación `. La autoespecificación se puede " -"realizar a través del argumento *autospec* de patch, o mediante la función :" -"func:`create_autospec`. La autoespecificación crea objetos simulados que " -"tienen los mismos atributos y métodos que los objetos que están reemplazando, " -"y todas las función y métodos (incluidos los constructores) tienen la misma " -"firma de llamada que los objetos reales." +"exactamente la misma API que los objetos que están reemplazando, puedes " +"usar :ref:`autoespecificación `. La autoespecificación se " +"puede realizar a través del argumento *autospec* de patch, o mediante la " +"función :func:`create_autospec`. La autoespecificación crea objetos " +"simulados que tienen los mismos atributos y métodos que los objetos que " +"están reemplazando, y todas las función y métodos (incluidos los " +"constructores) tienen la misma firma de llamada que los objetos reales." #: ../Doc/library/unittest.mock.rst:177 msgid "" @@ -239,12 +240,12 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:193 msgid "" ":func:`create_autospec` can also be used on classes, where it copies the " -"signature of the ``__init__`` method, and on callable objects where it copies " -"the signature of the ``__call__`` method." +"signature of the ``__init__`` method, and on callable objects where it " +"copies the signature of the ``__call__`` method." msgstr "" -":func:`create_autospec` también se puede usar en clases, donde copia la firma " -"del método ``__init__``, y en objetos invocables, donde copia la firma del " -"método ``__call__``." +":func:`create_autospec` también se puede usar en clases, donde copia la " +"firma del método ``__init__``, y en objetos invocables, donde copia la firma " +"del método ``__call__``." #: ../Doc/library/unittest.mock.rst:200 msgid "The Mock Class" @@ -303,15 +304,15 @@ msgid "" "*spec*: This can be either a list of strings or an existing object (a class " "or instance) that acts as the specification for the mock object. If you pass " "in an object then a list of strings is formed by calling dir on the object " -"(excluding unsupported magic attributes and methods). Accessing any attribute " -"not in this list will raise an :exc:`AttributeError`." +"(excluding unsupported magic attributes and methods). Accessing any " +"attribute not in this list will raise an :exc:`AttributeError`." msgstr "" "*spec*: Puede ser una lista de cadenas de caracteres o un objeto existente " "previamente (una clase o una instancia) que actúa como la especificación del " -"objeto simulado. Si pasas un objeto, se forma una lista de cadenas llamando a " -"la función *dir* en el objeto (excluyendo los métodos y atributos mágicos no " -"admitidos). Acceder a cualquier atributo que no esté en esta lista generará " -"una excepción :exc:`AttributeError`." +"objeto simulado. Si pasas un objeto, se forma una lista de cadenas llamando " +"a la función *dir* en el objeto (excluyendo los métodos y atributos mágicos " +"no admitidos). Acceder a cualquier atributo que no esté en esta lista " +"generará una excepción :exc:`AttributeError`." #: ../Doc/library/unittest.mock.rst:239 msgid "" @@ -325,13 +326,13 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:243 msgid "" -"*spec_set*: A stricter variant of *spec*. If used, attempting to *set* or get " -"an attribute on the mock that isn't on the object passed as *spec_set* will " -"raise an :exc:`AttributeError`." +"*spec_set*: A stricter variant of *spec*. If used, attempting to *set* or " +"get an attribute on the mock that isn't on the object passed as *spec_set* " +"will raise an :exc:`AttributeError`." msgstr "" "*spec_set*: Una variante más estricta de *spec*. Si se utiliza, cualquier " -"intento de *establecer* u obtener un atributo del objeto simulado que no esté " -"en el objeto pasado como *spec_set* lanzará una excepción :exc:" +"intento de *establecer* u obtener un atributo del objeto simulado que no " +"esté en el objeto pasado como *spec_set* lanzará una excepción :exc:" "`AttributeError`." #: ../Doc/library/unittest.mock.rst:247 @@ -342,8 +343,8 @@ msgid "" "arguments as the mock, and unless it returns :data:`DEFAULT`, the return " "value of this function is used as the return value." msgstr "" -"*side_effect*: Una función que se llamará cada vez que el objeto simulado sea " -"llamado. Consultar el atributo :attr:`~Mock.side_effect` para más " +"*side_effect*: Una función que se llamará cada vez que el objeto simulado " +"sea llamado. Consultar el atributo :attr:`~Mock.side_effect` para más " "información. Es útil para lanzar excepciones o para cambiar dinámicamente " "valores de retorno. La función se llama con los mismos argumentos que el " "objeto simulado, y a menos que retorne :data:`DEFAULT`, su valor de retorno " @@ -362,8 +363,8 @@ msgid "" "If *side_effect* is an iterable then each call to the mock will return the " "next value from the iterable." msgstr "" -"Si *side_effect* es un iterable, cada llamada al objeto simulado retornará el " -"siguiente valor del iterable." +"Si *side_effect* es un iterable, cada llamada al objeto simulado retornará " +"el siguiente valor del iterable." #: ../Doc/library/unittest.mock.rst:259 msgid "A *side_effect* can be cleared by setting it to ``None``." @@ -385,17 +386,19 @@ msgid "" "raise an :exc:`AttributeError`. Passing ``unsafe=True`` will allow access to " "these attributes." msgstr "" -"*unsafe*: Por defecto, si cualquier atributo comienza con *assert* o *assret* " -"y se intenta acceder a él, se lanza una excepción :exc:`AttributeError`. " -"Pasar ``unsafe=True`` permitirá el acceso a estos atributos." +"*unsafe*: Por defecto, si cualquier atributo comienza con *assert* o " +"*assret* y se intenta acceder a él, se lanza una excepción :exc:" +"`AttributeError`. Pasar ``unsafe=True`` permitirá el acceso a estos " +"atributos." #: ../Doc/library/unittest.mock.rst:271 msgid "" "*wraps*: Item for the mock object to wrap. If *wraps* is not ``None`` then " "calling the Mock will pass the call through to the wrapped object (returning " -"the real result). Attribute access on the mock will return a Mock object that " -"wraps the corresponding attribute of the wrapped object (so attempting to " -"access an attribute that doesn't exist will raise an :exc:`AttributeError`)." +"the real result). Attribute access on the mock will return a Mock object " +"that wraps the corresponding attribute of the wrapped object (so attempting " +"to access an attribute that doesn't exist will raise an :exc:" +"`AttributeError`)." msgstr "" "*wraps*: objeto a envolver (simular) por la instancia de Mock. Si *wraps* no " "es ``None``, al llamar al objeto Mock se pasa la llamada a través del objeto " @@ -424,8 +427,8 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:285 msgid "" -"Mocks can also be called with arbitrary keyword arguments. These will be used " -"to set attributes on the mock after it is created. See the :meth:" +"Mocks can also be called with arbitrary keyword arguments. These will be " +"used to set attributes on the mock after it is created. See the :meth:" "`configure_mock` method for details." msgstr "" "Los objetos simulados también pueden ser llamados con argumentos por palabra " @@ -443,8 +446,8 @@ msgstr "Aserta si el objeto simulado se ha llamado exactamente una vez." #: ../Doc/library/unittest.mock.rst:320 msgid "" -"This method is a convenient way of asserting that the last call has been made " -"in a particular way:" +"This method is a convenient way of asserting that the last call has been " +"made in a particular way:" msgstr "" "Este método es una manera apropiada de asertar si la última llamada se ha " "realizado de una manera particular:" @@ -480,13 +483,13 @@ msgid "" "assert the mock has been called with the specified calls. The :attr:" "`mock_calls` list is checked for the calls." msgstr "" -"Aserta si el objeto simulado se ha llamado con las llamadas especificadas. La " -"lista :attr:`mock_calls` se compara con la lista de llamadas." +"Aserta si el objeto simulado se ha llamado con las llamadas especificadas. " +"La lista :attr:`mock_calls` se compara con la lista de llamadas." #: ../Doc/library/unittest.mock.rst:363 msgid "" -"If *any_order* is false then the calls must be sequential. There can be extra " -"calls before or after the specified calls." +"If *any_order* is false then the calls must be sequential. There can be " +"extra calls before or after the specified calls." msgstr "" "Si *any_order* es falso entonces las llamadas deben ser secuenciales. No " "puede haber llamadas adicionales antes o después de las llamadas " @@ -507,8 +510,8 @@ msgstr "Aserta si el objeto simulado nunca fue llamado." #: ../Doc/library/unittest.mock.rst:397 msgid "The reset_mock method resets all the call attributes on a mock object:" msgstr "" -"El método *reset_mock* restablece todos los atributos de llamada en un objeto " -"simulado:" +"El método *reset_mock* restablece todos los atributos de llamada en un " +"objeto simulado:" #: ../Doc/library/unittest.mock.rst:407 msgid "Added two keyword only argument to the reset_mock function." @@ -520,16 +523,17 @@ msgid "" "the same object. Note that :meth:`reset_mock` *doesn't* clear the return " "value, :attr:`side_effect` or any child attributes you have set using normal " "assignment by default. In case you want to reset *return_value* or :attr:" -"`side_effect`, then pass the corresponding parameter as ``True``. Child mocks " -"and the return value mock (if any) are reset as well." +"`side_effect`, then pass the corresponding parameter as ``True``. Child " +"mocks and the return value mock (if any) are reset as well." msgstr "" "Esto puede ser útil cuando se quiere hacer una serie de aserciones que " "reutilizan el mismo objeto. Ten en cuenta que por defecto :meth:`reset_mock` " "*no* borra el valor de retorno, :attr:`side_effect`, ni cualquier atributo " -"hijo que hayas establecido mediante asignación normal. En caso de que quieras " -"restablecer *return_value* o :attr:`side_effect`, debes pasar el parámetro " -"correspondiente como ``True``. Los objetos simulados hijos y el objeto " -"simulado que conforma el valor de retorno (si los hay) se restablecen también." +"hijo que hayas establecido mediante asignación normal. En caso de que " +"quieras restablecer *return_value* o :attr:`side_effect`, debes pasar el " +"parámetro correspondiente como ``True``. Los objetos simulados hijos y el " +"objeto simulado que conforma el valor de retorno (si los hay) se restablecen " +"también." #: ../Doc/library/unittest.mock.rst:418 msgid "*return_value*, and :attr:`side_effect` are keyword only argument." @@ -559,9 +563,9 @@ msgid "" "attr:`mock_calls` attributes of this one." msgstr "" "Adjunta otro objeto simulado como un atributo de la instancia actual, " -"substituyendo su nombre y su padre. Las llamadas al objeto simulado adjuntado " -"se registrarán en los atributos :attr:`method_calls` y :attr:`mock_calls` del " -"padre." +"substituyendo su nombre y su padre. Las llamadas al objeto simulado " +"adjuntado se registrarán en los atributos :attr:`method_calls` y :attr:" +"`mock_calls` del padre." #: ../Doc/library/unittest.mock.rst:440 msgid "Set attributes on the mock through keyword arguments." @@ -586,8 +590,8 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:469 msgid "" -":meth:`configure_mock` exists to make it easier to do configuration after the " -"mock has been created." +":meth:`configure_mock` exists to make it easier to do configuration after " +"the mock has been created." msgstr "" ":meth:`configure_mock` existe con el fin de facilitar la configuración " "después de que el objeto simulado haya sido creado." @@ -604,7 +608,8 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:479 msgid "" -"See :data:`FILTER_DIR` for what this filtering does, and how to switch it off." +"See :data:`FILTER_DIR` for what this filtering does, and how to switch it " +"off." msgstr "" "Consultar :data:`FILTER_DIR` para conocer que hace este filtrado y la forma " "de desactivarlo." @@ -617,16 +622,16 @@ msgid "" msgstr "" "Crea los objetos simulados hijos para los atributos y el valor de retorno. " "Por defecto los objetos simulados hijos serán del mismo tipo que el padre. " -"Las subclases de Mock pueden redefinir este método para personalizar la forma " -"en la que se construye el objeto simulado hijo." +"Las subclases de Mock pueden redefinir este método para personalizar la " +"forma en la que se construye el objeto simulado hijo." #: ../Doc/library/unittest.mock.rst:490 msgid "" "For non-callable mocks the callable variant will be used (rather than any " "custom subclass)." msgstr "" -"Para objetos simulados no invocables la variante invocable será utilizada (en " -"lugar de cualquier subclase personalizada)." +"Para objetos simulados no invocables la variante invocable será utilizada " +"(en lugar de cualquier subclase personalizada)." #: ../Doc/library/unittest.mock.rst:496 msgid "A boolean representing whether or not the mock object has been called:" @@ -648,8 +653,8 @@ msgid "" "The default return value is a mock object and you can configure it in the " "normal way:" msgstr "" -"El valor de retorno por defecto es otro objeto simulado y se puede configurar " -"de forma habitual:" +"El valor de retorno por defecto es otro objeto simulado y se puede " +"configurar de forma habitual:" #: ../Doc/library/unittest.mock.rst:535 msgid ":attr:`return_value` can also be set in the constructor:" @@ -668,16 +673,16 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:549 msgid "" "If you pass in a function it will be called with same arguments as the mock " -"and unless the function returns the :data:`DEFAULT` singleton the call to the " -"mock will then return whatever the function returns. If the function returns :" -"data:`DEFAULT` then the mock will return its normal value (from the :attr:" -"`return_value`)." +"and unless the function returns the :data:`DEFAULT` singleton the call to " +"the mock will then return whatever the function returns. If the function " +"returns :data:`DEFAULT` then the mock will return its normal value (from " +"the :attr:`return_value`)." msgstr "" "Si pasas una función, será llamada con los mismos argumentos que el objeto " "simulado y, a menos que la función retorne el singleton :data:`DEFAULT`, la " "llamada al objeto simulado retornará lo mismo que retorna la función. En " -"cambio, si la función retorna :data:`DEFAULT` el objeto simulado retornará su " -"valor normal (el del atributo :attr:`return_value`)." +"cambio, si la función retorna :data:`DEFAULT` el objeto simulado retornará " +"su valor normal (el del atributo :attr:`return_value`)." #: ../Doc/library/unittest.mock.rst:555 msgid "" @@ -726,14 +731,14 @@ msgid "" "that the mock was last called with. This will be in the form of a tuple: the " "first member, which can also be accessed through the ``args`` property, is " "any ordered arguments the mock was called with (or an empty tuple) and the " -"second member, which can also be accessed through the ``kwargs`` property, is " -"any keyword arguments (or an empty dictionary)." +"second member, which can also be accessed through the ``kwargs`` property, " +"is any keyword arguments (or an empty dictionary)." msgstr "" "Este atributo es ``None`` (si el objeto simulado no ha sido llamado) o los " -"argumentos con los que se llamó por última vez. En este último caso, será una " -"tupla con dos elementos: el primer miembro, que también es accesible a través " -"de la propiedad ``args``, son los argumentos posicionales con los que el " -"objeto simulado se llamó (o una tupla vacía si no se pasó ninguno) y el " +"argumentos con los que se llamó por última vez. En este último caso, será " +"una tupla con dos elementos: el primer miembro, que también es accesible a " +"través de la propiedad ``args``, son los argumentos posicionales con los que " +"el objeto simulado se llamó (o una tupla vacía si no se pasó ninguno) y el " "segundo miembro, que también es accesible mediante la propiedad ``kwargs``, " "son los argumento por palabra clave pasados (o un diccionario vacío si no se " "pasó ninguno)." @@ -746,25 +751,26 @@ msgid "" "make more complex assertions. See :ref:`calls as tuples `." msgstr "" "El atributo :attr:`call_args`, junto con los miembros de las listas :attr:" -"`call_args_list`, :attr:`method_calls` y :attr:`mock_calls` son objetos :data:" -"`call`. Estos objetos son tuplas, con la finalidad de que puedan ser " -"desempaquetadas para acceder a los argumentos individuales y hacer aserciones " -"más complejas. Consultar :ref:`objetos call como tuplas ` " -"para más información." +"`call_args_list`, :attr:`method_calls` y :attr:`mock_calls` son objetos :" +"data:`call`. Estos objetos son tuplas, con la finalidad de que puedan ser " +"desempaquetadas para acceder a los argumentos individuales y hacer " +"aserciones más complejas. Consultar :ref:`objetos call como tuplas ` para más información." #: ../Doc/library/unittest.mock.rst:653 msgid "" "This is a list of all the calls made to the mock object in sequence (so the " "length of the list is the number of times it has been called). Before any " -"calls have been made it is an empty list. The :data:`call` object can be used " -"for conveniently constructing lists of calls to compare with :attr:" +"calls have been made it is an empty list. The :data:`call` object can be " +"used for conveniently constructing lists of calls to compare with :attr:" "`call_args_list`." msgstr "" "Este argumento es una lista de todas las llamadas consecutivas realizadas al " -"objeto simulado (por lo que la longitud de la lista es el número de veces que " -"se ha llamado). Previamente a que se hayan realizado llamadas es una lista " -"vacía. El objeto :data:`call` se puede utilizar para construir " -"convenientemente las listas de llamadas a comparar con :attr:`call_args_list`." +"objeto simulado (por lo que la longitud de la lista es el número de veces " +"que se ha llamado). Previamente a que se hayan realizado llamadas es una " +"lista vacía. El objeto :data:`call` se puede utilizar para construir " +"convenientemente las listas de llamadas a comparar con :attr:" +"`call_args_list`." #: ../Doc/library/unittest.mock.rst:669 msgid "" @@ -772,10 +778,10 @@ msgid "" "unpacked as tuples to get at the individual arguments. See :ref:`calls as " "tuples `." msgstr "" -"Los miembros de :attr:`call_args_list` son objetos :data:`call`. Estos pueden " -"ser desempaquetados como tuplas para acceder a los argumentos individuales. " -"Consultar :ref:`objetos call como tuplas ` para más " -"información." +"Los miembros de :attr:`call_args_list` son objetos :data:`call`. Estos " +"pueden ser desempaquetados como tuplas para acceder a los argumentos " +"individuales. Consultar :ref:`objetos call como tuplas ` " +"para más información." #: ../Doc/library/unittest.mock.rst:676 msgid "" @@ -799,20 +805,20 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:694 msgid "" -":attr:`mock_calls` records *all* calls to the mock object, its methods, magic " -"methods *and* return value mocks." +":attr:`mock_calls` records *all* calls to the mock object, its methods, " +"magic methods *and* return value mocks." msgstr "" ":attr:`mock_calls` registra *todas* las llamadas al objeto simulado, sus " "métodos, métodos mágicos *y* objetos simulados del valor de retorno." #: ../Doc/library/unittest.mock.rst:712 msgid "" -"Members of :attr:`mock_calls` are :data:`call` objects. These can be unpacked " -"as tuples to get at the individual arguments. See :ref:`calls as tuples " -"`." +"Members of :attr:`mock_calls` are :data:`call` objects. These can be " +"unpacked as tuples to get at the individual arguments. See :ref:`calls as " +"tuples `." msgstr "" -"Los miembros de :attr:`mock_calls` son objetos :data:`call`. Estos pueden ser " -"desempaquetados como tuplas para acceder a los argumentos individuales. " +"Los miembros de :attr:`mock_calls` son objetos :data:`call`. Estos pueden " +"ser desempaquetados como tuplas para acceder a los argumentos individuales. " "Consultar :ref:`objetos call como tuplas ` para más " "información." @@ -835,8 +841,9 @@ msgid "" msgstr "" "Normalmente, el atributo de un objeto :attr:`__class__` retornará su tipo. " "Para un objeto simulado con un :attr:`spec`, ``__class__`` retorna la clase " -"especificada en su lugar. Esto permite a los objetos simulados pasar los test " -"de :func:`isinstance` para el objeto que están reemplazando / enmascarando:" +"especificada en su lugar. Esto permite a los objetos simulados pasar los " +"test de :func:`isinstance` para el objeto que están reemplazando / " +"enmascarando:" #: ../Doc/library/unittest.mock.rst:741 msgid "" @@ -844,8 +851,8 @@ msgid "" "`isinstance` check without forcing you to use a spec:" msgstr "" "El atributo :attr:`__class__` es asignable, esto permite al objeto simulado " -"pasar una verificación de :func:`isinstance` sin verse forzado a utilizar una " -"especificación:" +"pasar una verificación de :func:`isinstance` sin verse forzado a utilizar " +"una especificación:" #: ../Doc/library/unittest.mock.rst:751 msgid "" @@ -855,16 +862,16 @@ msgid "" msgstr "" "Una versión no invocable de :class:`Mock`. Los parámetros del constructor " "tienen el mismo significado que en :class:`Mock`, con la excepción de " -"*return_value* y *side_effect* que no tienen sentido en un objeto simulado no " -"invocable." +"*return_value* y *side_effect* que no tienen sentido en un objeto simulado " +"no invocable." #: ../Doc/library/unittest.mock.rst:755 msgid "" "Mock objects that use a class or an instance as a :attr:`spec` or :attr:" "`spec_set` are able to pass :func:`isinstance` tests:" msgstr "" -"Los objetos simulados que usan una clase o una instancia como :attr:`spec` o :" -"attr:`spec_set` son capaces de pasar los test de :func:`isinstance`:" +"Los objetos simulados que usan una clase o una instancia como :attr:`spec` " +"o :attr:`spec_set` son capaces de pasar los test de :func:`isinstance`:" #: ../Doc/library/unittest.mock.rst:765 msgid "" @@ -882,11 +889,11 @@ msgid "" "are passed to the constructor of the mock being created. The keyword " "arguments are for configuring attributes of the mock:" msgstr "" -"Las clases simuladas y los decoradores :func:`patch` aceptan todas argumentos " -"por palabra clave arbitrarios para la configuración. En los decoradores :func:" -"`patch` los argumentos por palabra clave se pasan al constructor del objeto " -"simulado creado. Estos argumentos se usan para configurar los atributos del " -"propio objeto simulado:" +"Las clases simuladas y los decoradores :func:`patch` aceptan todas " +"argumentos por palabra clave arbitrarios para la configuración. En los " +"decoradores :func:`patch` los argumentos por palabra clave se pasan al " +"constructor del objeto simulado creado. Estos argumentos se usan para " +"configurar los atributos del propio objeto simulado:" #: ../Doc/library/unittest.mock.rst:779 msgid "" @@ -894,11 +901,11 @@ msgid "" "using dotted notation. As you can't use dotted names directly in a call you " "have to create a dictionary and unpack it using ``**``:" msgstr "" -"Tanto el valor de retorno como el efecto colateral del objeto simulado pueden " -"ser establecidos de la misma manera, mediante notación de punto. En cambio, " -"si se quieren establecer mediante el constructor, dado que no se puede " -"utilizar notación de punto directamente en una llamada, se tiene que crear un " -"diccionario y desempaquetarlo usando ``**``:" +"Tanto el valor de retorno como el efecto colateral del objeto simulado " +"pueden ser establecidos de la misma manera, mediante notación de punto. En " +"cambio, si se quieren establecer mediante el constructor, dado que no se " +"puede utilizar notación de punto directamente en una llamada, se tiene que " +"crear un diccionario y desempaquetarlo usando ``**``:" #: ../Doc/library/unittest.mock.rst:794 msgid "" @@ -937,15 +944,15 @@ msgid "" "class:`PropertyMock` provides :meth:`__get__` and :meth:`__set__` methods so " "you can specify a return value when it is fetched." msgstr "" -"Un objeto simulado destinado a ser utilizado en una clase como una propiedad, " -"u otro descriptor. La clase :class:`PropertyMock` proporciona los métodos :" -"meth:`__get__` y :meth:`__set__`, por lo que puedes especificar un valor de " -"retorno para cuando su valor es requerido." +"Un objeto simulado destinado a ser utilizado en una clase como una " +"propiedad, u otro descriptor. La clase :class:`PropertyMock` proporciona los " +"métodos :meth:`__get__` y :meth:`__set__`, por lo que puedes especificar un " +"valor de retorno para cuando su valor es requerido." #: ../Doc/library/unittest.mock.rst:822 msgid "" -"Fetching a :class:`PropertyMock` instance from an object calls the mock, with " -"no args. Setting it calls the mock with the value being set. ::" +"Fetching a :class:`PropertyMock` instance from an object calls the mock, " +"with no args. Setting it calls the mock with the value being set. ::" msgstr "" "La obtención de una instancia desde un objeto :class:`PropertyMock` ocasiona " "una llamada al objeto simulado, sin argumentos. Establecer su valor también " @@ -968,8 +975,8 @@ msgid "" "call is an awaitable." msgstr "" "Una versión asíncrona de :class:`Mock`. El objeto :class:`AsyncMock` se " -"comportará de tal modo que el objeto es reconocido como una función asíncrona " -"y el resultado de su llamada es un objeto 'esperable' (awaitable)." +"comportará de tal modo que el objeto es reconocido como una función " +"asíncrona y el resultado de su llamada es un objeto 'esperable' (awaitable)." #: ../Doc/library/unittest.mock.rst:867 msgid "" @@ -1034,13 +1041,13 @@ msgid "" "or :class:`Mock` (if the parent mock is :class:`Mock`). All asynchronous " "functions will be :class:`AsyncMock`." msgstr "" -"Establecer el argumento *spec* de un objeto :class:`Mock`, :class:`MagicMock` " -"o :class:`AsyncMock` en una clase que tiene simultáneamente funciones " -"asíncronas y síncronas hará que se detecten automáticamente las funciones " -"sincrónicas y las establecerá como :class:`MagicMock` (si el objeto simulado " -"padre es :class:`AsyncMock` o :class:`MagicMock`) o :class:`Mock` (si el " -"objeto simulado padre es :class:`Mock`) . Todas las funciones asíncronas " -"serán :class:`AsyncMock`." +"Establecer el argumento *spec* de un objeto :class:`Mock`, :class:" +"`MagicMock` o :class:`AsyncMock` en una clase que tiene simultáneamente " +"funciones asíncronas y síncronas hará que se detecten automáticamente las " +"funciones sincrónicas y las establecerá como :class:`MagicMock` (si el " +"objeto simulado padre es :class:`AsyncMock` o :class:`MagicMock`) o :class:" +"`Mock` (si el objeto simulado padre es :class:`Mock`) . Todas las funciones " +"asíncronas serán :class:`AsyncMock`." #: ../Doc/library/unittest.mock.rst:922 msgid "" @@ -1094,8 +1101,8 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:1014 msgid "" -"If *any_order* is true then the awaits can be in any order, but they must all " -"appear in :attr:`await_args_list`." +"If *any_order* is true then the awaits can be in any order, but they must " +"all appear in :attr:`await_args_list`." msgstr "" "Si *any_order* es verdadero, entonces las 'esperas' (awaits) pueden estar en " "cualquier orden, pero deben aparecer todas en :attr:`await_args_list`." @@ -1134,10 +1141,10 @@ msgid "" "length of the list is the number of times it has been awaited). Before any " "awaits have been made it is an empty list." msgstr "" -"Es una lista de todas las 'esperas' (awaits) realizadas en el objeto simulado " -"de forma secuencial (por lo que la longitud de la lista es el número de veces " -"que se ha 'esperado' el objeto). Si no se han realizado 'esperas' previas es " -"una lista vacía." +"Es una lista de todas las 'esperas' (awaits) realizadas en el objeto " +"simulado de forma secuencial (por lo que la longitud de la lista es el " +"número de veces que se ha 'esperado' el objeto). Si no se han realizado " +"'esperas' previas es una lista vacía." #: ../Doc/library/unittest.mock.rst:1098 msgid "Calling" @@ -1154,22 +1161,22 @@ msgstr "" "Los objetos Mock son invocables. La llamada a uno retornará el valor " "establecido en el atributo :attr:`~Mock.return_value`. El valor de retorno " "por defecto es un nuevo objeto Mock, el cual se crea la primera vez que se " -"accede al valor de retorno (ya sea explícitamente o llamando al objeto Mock). " -"Una vez creado, se almacena y el mismo objeto es retornado cada vez que se " -"solicita." +"accede al valor de retorno (ya sea explícitamente o llamando al objeto " +"Mock). Una vez creado, se almacena y el mismo objeto es retornado cada vez " +"que se solicita." #: ../Doc/library/unittest.mock.rst:1106 msgid "" -"Calls made to the object will be recorded in the attributes like :attr:`~Mock." -"call_args` and :attr:`~Mock.call_args_list`." +"Calls made to the object will be recorded in the attributes like :attr:" +"`~Mock.call_args` and :attr:`~Mock.call_args_list`." msgstr "" "Las llamadas realizadas al objeto serán registradas en los atributos :attr:" "`~Mock.call_args` y :attr:`~Mock.call_args_list`." #: ../Doc/library/unittest.mock.rst:1109 msgid "" -"If :attr:`~Mock.side_effect` is set then it will be called after the call has " -"been recorded, so if :attr:`side_effect` raises an exception the call is " +"If :attr:`~Mock.side_effect` is set then it will be called after the call " +"has been recorded, so if :attr:`side_effect` raises an exception the call is " "still recorded." msgstr "" "Si :attr:`~Mock.side_effect` se establece, será llamado después de que la " @@ -1189,8 +1196,8 @@ msgstr "" msgid "" "If :attr:`side_effect` is a function then whatever that function returns is " "what calls to the mock return. The :attr:`side_effect` function is called " -"with the same arguments as the mock. This allows you to vary the return value " -"of the call dynamically, based on the input:" +"with the same arguments as the mock. This allows you to vary the return " +"value of the call dynamically, based on the input:" msgstr "" "Si :attr:`side_effect` es una función, la llamada al objeto simulado " "retornará lo que sea que esta función retorne. La función establecida en :" @@ -1205,10 +1212,10 @@ msgid "" "return :attr:`mock.return_value` from inside :attr:`side_effect`, or return :" "data:`DEFAULT`:" msgstr "" -"Si se desea que el objeto simulado aún retorne el valor por defecto (un nuevo " -"objeto simulado), o cualquier valor de retorno establecido, entonces existen " -"dos maneras de proceder. Se puede retornar tanto el atributo :attr:`mock." -"return_value` como :data:`DEFAULT` desde :attr:`side_effect`:" +"Si se desea que el objeto simulado aún retorne el valor por defecto (un " +"nuevo objeto simulado), o cualquier valor de retorno establecido, entonces " +"existen dos maneras de proceder. Se puede retornar tanto el atributo :attr:" +"`mock.return_value` como :data:`DEFAULT` desde :attr:`side_effect`:" #: ../Doc/library/unittest.mock.rst:1166 msgid "" @@ -1288,7 +1295,8 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:1252 msgid "" -"A simpler option is to simply set the \"name\" attribute after mock creation::" +"A simpler option is to simply set the \"name\" attribute after mock " +"creation::" msgstr "" "Una opción más sencilla es simplemente establecer el atributo \"name\" " "después de la creación del objeto simulado:" @@ -1303,18 +1311,18 @@ msgid "" "value) it becomes a \"child\" of that mock. Calls to the child are recorded " "in the :attr:`~Mock.method_calls` and :attr:`~Mock.mock_calls` attributes of " "the parent. This is useful for configuring child mocks and then attaching " -"them to the parent, or for attaching mocks to a parent that records all calls " -"to the children and allows you to make assertions about the order of calls " -"between mocks:" -msgstr "" -"Cuando se adjunta un objeto simulado como un atributo de otro objeto simulado " -"(o como su valor de retorno) se convierte en un \"hijo\" del mismo. Las " -"llamadas a los hijos se registran en los atributos :attr:`~Mock.method_calls` " -"y :attr:`~Mock.mock_calls` del padre. Esto es útil para configurar objetos " -"simulados hijos para después adjuntarlos al padre, o para adjuntar objetos " -"simulados a un padre que se encargará de registrar todas las llamadas a los " -"hijos, permitiéndote hacer aserciones sobre el orden de las llamadas entre " -"objetos simulados:" +"them to the parent, or for attaching mocks to a parent that records all " +"calls to the children and allows you to make assertions about the order of " +"calls between mocks:" +msgstr "" +"Cuando se adjunta un objeto simulado como un atributo de otro objeto " +"simulado (o como su valor de retorno) se convierte en un \"hijo\" del mismo. " +"Las llamadas a los hijos se registran en los atributos :attr:`~Mock." +"method_calls` y :attr:`~Mock.mock_calls` del padre. Esto es útil para " +"configurar objetos simulados hijos para después adjuntarlos al padre, o para " +"adjuntar objetos simulados a un padre que se encargará de registrar todas " +"las llamadas a los hijos, permitiéndote hacer aserciones sobre el orden de " +"las llamadas entre objetos simulados:" #: ../Doc/library/unittest.mock.rst:1279 msgid "" @@ -1332,17 +1340,17 @@ msgid "" "attach_mock` method::" msgstr "" "Los objetos simulados creados automáticamente por la función :func:`patch` " -"también reciben nombres automáticamente. Para adjuntar un objeto simulado con " -"nombre a un padre debes utilizar el método :meth:`~Mock.attach_mock`:" +"también reciben nombres automáticamente. Para adjuntar un objeto simulado " +"con nombre a un padre debes utilizar el método :meth:`~Mock.attach_mock`:" #: ../Doc/library/unittest.mock.rst:1308 msgid "" -"The only exceptions are magic methods and attributes (those that have leading " -"and trailing double underscores). Mock doesn't create these but instead " -"raises an :exc:`AttributeError`. This is because the interpreter will often " -"implicitly request these methods, and gets *very* confused to get a new Mock " -"object when it expects a magic method. If you need magic method support see :" -"ref:`magic methods `." +"The only exceptions are magic methods and attributes (those that have " +"leading and trailing double underscores). Mock doesn't create these but " +"instead raises an :exc:`AttributeError`. This is because the interpreter " +"will often implicitly request these methods, and gets *very* confused to get " +"a new Mock object when it expects a magic method. If you need magic method " +"support see :ref:`magic methods `." msgstr "" "Las únicas excepciones son los métodos y atributos mágicos (aquellos que " "tienen doble subrayado al principio y al final). Mock no los crea " @@ -1359,9 +1367,9 @@ msgstr "Parcheadores" #: ../Doc/library/unittest.mock.rst:1319 msgid "" "The patch decorators are used for patching objects only within the scope of " -"the function they decorate. They automatically handle the unpatching for you, " -"even if exceptions are raised. All of these functions can also be used in " -"with statements or as class decorators." +"the function they decorate. They automatically handle the unpatching for " +"you, even if exceptions are raised. All of these functions can also be used " +"in with statements or as class decorators." msgstr "" "Los decoradores path se utilizan para parchear los objetos sólo dentro del " "ámbito de la función que decoran. Se encargan automáticamente de desparchear " @@ -1375,8 +1383,8 @@ msgstr "patch" #: ../Doc/library/unittest.mock.rst:1330 msgid "" -":func:`patch` is straightforward to use. The key is to do the patching in the " -"right namespace. See the section `where to patch`_." +":func:`patch` is straightforward to use. The key is to do the patching in " +"the right namespace. See the section `where to patch`_." msgstr "" "La función :func:`patch` es sencilla de usar. La clave es realizar la " "aplicación de parches en el espacio de nombres correcto. Consulta la sección " @@ -1386,28 +1394,28 @@ msgstr "" msgid "" ":func:`patch` acts as a function decorator, class decorator or a context " "manager. Inside the body of the function or with statement, the *target* is " -"patched with a *new* object. When the function/with statement exits the patch " -"is undone." +"patched with a *new* object. When the function/with statement exits the " +"patch is undone." msgstr "" ":func:`patch` actúa como decorador de función, decorador de clase o como " "gestor de contexto. Ya sea en el interior del cuerpo de una función o dentro " -"de una declaración with, *target* es parcheado con un objeto *new*. Cuando la " -"función / declaración with termina su ejecución el parche se deshace " +"de una declaración with, *target* es parcheado con un objeto *new*. Cuando " +"la función / declaración with termina su ejecución el parche se deshace " "automáticamente." #: ../Doc/library/unittest.mock.rst:1340 msgid "" "If *new* is omitted, then the target is replaced with an :class:`AsyncMock` " -"if the patched object is an async function or a :class:`MagicMock` otherwise. " -"If :func:`patch` is used as a decorator and *new* is omitted, the created " -"mock is passed in as an extra argument to the decorated function. If :func:" -"`patch` is used as a context manager the created mock is returned by the " -"context manager." +"if the patched object is an async function or a :class:`MagicMock` " +"otherwise. If :func:`patch` is used as a decorator and *new* is omitted, the " +"created mock is passed in as an extra argument to the decorated function. " +"If :func:`patch` is used as a context manager the created mock is returned " +"by the context manager." msgstr "" "Si se omite *new*, entonces el objetivo se reemplaza por un objeto :class:" -"`AsyncMock` si el objeto parcheado es una función asíncrona, o con un objeto :" -"class:`MagicMock` en caso contrario. Si se utiliza :func:`patch` como " -"decorador y se omite *new*, el objeto simulado creado se pasa como un " +"`AsyncMock` si el objeto parcheado es una función asíncrona, o con un " +"objeto :class:`MagicMock` en caso contrario. Si se utiliza :func:`patch` " +"como decorador y se omite *new*, el objeto simulado creado se pasa como un " "argumento adicional a la función decorada. Si se utiliza :func:`patch` como " "un gestor de contexto, el objeto simulado creado es retornado por el gestor " "de contexto." @@ -1415,10 +1423,10 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:1348 msgid "" "*target* should be a string in the form ``'package.module.ClassName'``. The " -"*target* is imported and the specified object replaced with the *new* object, " -"so the *target* must be importable from the environment you are calling :func:" -"`patch` from. The target is imported when the decorated function is executed, " -"not at decoration time." +"*target* is imported and the specified object replaced with the *new* " +"object, so the *target* must be importable from the environment you are " +"calling :func:`patch` from. The target is imported when the decorated " +"function is executed, not at decoration time." msgstr "" "*target* debe ser una cadena de la forma ``'paquete.modulo." "NombreDeLaClase'``. *target* es importado y el objeto especificado " @@ -1432,49 +1440,49 @@ msgid "" "The *spec* and *spec_set* keyword arguments are passed to the :class:" "`MagicMock` if patch is creating one for you." msgstr "" -"Los argumentos *spec* y *spec_set* se pasan a :class:`MagicMock` si path está " -"creando automáticamente uno para ti." +"Los argumentos *spec* y *spec_set* se pasan a :class:`MagicMock` si path " +"está creando automáticamente uno para ti." #: ../Doc/library/unittest.mock.rst:1357 msgid "" "In addition you can pass ``spec=True`` or ``spec_set=True``, which causes " "patch to pass in the object being mocked as the spec/spec_set object." msgstr "" -"Además, puedes pasar ``spec=True`` o ``spec_set=True``, lo que causa que path " -"pase el objeto que está siendo simulado como el objeto spec/spec_set." +"Además, puedes pasar ``spec=True`` o ``spec_set=True``, lo que causa que " +"path pase el objeto que está siendo simulado como el objeto spec/spec_set." #: ../Doc/library/unittest.mock.rst:1360 msgid "" "*new_callable* allows you to specify a different class, or callable object, " -"that will be called to create the *new* object. By default :class:`AsyncMock` " -"is used for async functions and :class:`MagicMock` for the rest." +"that will be called to create the *new* object. By default :class:" +"`AsyncMock` is used for async functions and :class:`MagicMock` for the rest." msgstr "" "*new_callable* te permite especificar una clase diferente, o un objeto " "invocable, que será llamada para crear el objeto *new*. Por defecto se " -"utiliza :class:`AsyncMock` para las funciones asíncronas y :class:`MagicMock` " -"para el resto." +"utiliza :class:`AsyncMock` para las funciones asíncronas y :class:" +"`MagicMock` para el resto." #: ../Doc/library/unittest.mock.rst:1364 msgid "" "A more powerful form of *spec* is *autospec*. If you set ``autospec=True`` " -"then the mock will be created with a spec from the object being replaced. All " -"attributes of the mock will also have the spec of the corresponding attribute " -"of the object being replaced. Methods and functions being mocked will have " -"their arguments checked and will raise a :exc:`TypeError` if they are called " -"with the wrong signature. For mocks replacing a class, their return value " -"(the 'instance') will have the same spec as the class. See the :func:" -"`create_autospec` function and :ref:`auto-speccing`." +"then the mock will be created with a spec from the object being replaced. " +"All attributes of the mock will also have the spec of the corresponding " +"attribute of the object being replaced. Methods and functions being mocked " +"will have their arguments checked and will raise a :exc:`TypeError` if they " +"are called with the wrong signature. For mocks replacing a class, their " +"return value (the 'instance') will have the same spec as the class. See the :" +"func:`create_autospec` function and :ref:`auto-speccing`." msgstr "" "Una variante más poderosa de *spec* es *autospec*. Si estableces " "``autospec=True`` el objeto simulado se creará con una especificación del " "objeto que está siendo reemplazado. Todos los atributos del objeto simulado " -"también tendrán la especificación del atributo correspondiente del objeto que " -"está siendo reemplazado. Los argumentos de los métodos y funciones simulados " -"son comprobados y se lanzará una excepción :exc:`TypeError` si se les llama " -"con la firma incorrecta. Para los objetos simulados que sustituyen a una " -"clase, su valor de retorno (la 'instancia') tendrá la misma especificación " -"que la clase. Consultar la función :func:`create_autospec` y :ref:`auto-" -"speccing` para más detalles." +"también tendrán la especificación del atributo correspondiente del objeto " +"que está siendo reemplazado. Los argumentos de los métodos y funciones " +"simulados son comprobados y se lanzará una excepción :exc:`TypeError` si se " +"les llama con la firma incorrecta. Para los objetos simulados que sustituyen " +"a una clase, su valor de retorno (la 'instancia') tendrá la misma " +"especificación que la clase. Consultar la función :func:`create_autospec` y :" +"ref:`auto-speccing` para más detalles." #: ../Doc/library/unittest.mock.rst:1374 msgid "" @@ -1487,13 +1495,13 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:1377 msgid "" -"By default :func:`patch` will fail to replace attributes that don't exist. If " -"you pass in ``create=True``, and the attribute doesn't exist, patch will " +"By default :func:`patch` will fail to replace attributes that don't exist. " +"If you pass in ``create=True``, and the attribute doesn't exist, patch will " "create the attribute for you when the patched function is called, and delete " "it again after the patched function has exited. This is useful for writing " "tests against attributes that your production code creates at runtime. It is " -"off by default because it can be dangerous. With it switched on you can write " -"passing tests against APIs that don't actually exist!" +"off by default because it can be dangerous. With it switched on you can " +"write passing tests against APIs that don't actually exist!" msgstr "" "Por defecto, :func:`patch` fallará al intentar reemplazar atributos que no " "existen. Si pasas ``create=True`` y no existe el atributo, patch crea el " @@ -1519,16 +1527,17 @@ msgid "" "when your test methods share a common patchings set. :func:`patch` finds " "tests by looking for method names that start with ``patch.TEST_PREFIX``. By " "default this is ``'test'``, which matches the way :mod:`unittest` finds " -"tests. You can specify an alternative prefix by setting ``patch.TEST_PREFIX``." +"tests. You can specify an alternative prefix by setting ``patch." +"TEST_PREFIX``." msgstr "" "Path puede ser usado como un decorador de la clase :class:`TestCase`. " "Funciona decorando cada uno de los métodos de prueba presentes en la clase. " "Esto reduce el código repetitivo cuando tus métodos de prueba comparten un " "conjunto de parcheo común. :func:`patch` encuentra las pruebas mediante la " "búsqueda de métodos cuyos nombres comienzan con ``patch.TEST_PREFIX``. Por " -"defecto es ``'test'``, que coincide con la forma en que :mod:`unittest` busca " -"las pruebas. Se puede especificar un prefijo alternativo estableciendo un " -"nuevo valor para el atributo ``patch.TEST_PREFIX``." +"defecto es ``'test'``, que coincide con la forma en que :mod:`unittest` " +"busca las pruebas. Se puede especificar un prefijo alternativo estableciendo " +"un nuevo valor para el atributo ``patch.TEST_PREFIX``." #: ../Doc/library/unittest.mock.rst:1398 msgid "" @@ -1537,16 +1546,16 @@ msgid "" "\"as\" then the patched object will be bound to the name after the \"as\"; " "very useful if :func:`patch` is creating a mock object for you." msgstr "" -"Patch puede ser usado como un gestor de contexto, con la declaración with. En " -"este caso el parcheo se aplica al bloque sangrado inmediatamente después de " -"la declaración with. Si utilizas \"as\", el objeto parcheado será enlazado al " -"nombre especificado después de \"as\"; muy útil si :func:`patch` está creando " -"un objeto simulado automáticamente." +"Patch puede ser usado como un gestor de contexto, con la declaración with. " +"En este caso el parcheo se aplica al bloque sangrado inmediatamente después " +"de la declaración with. Si utilizas \"as\", el objeto parcheado será " +"enlazado al nombre especificado después de \"as\"; muy útil si :func:`patch` " +"está creando un objeto simulado automáticamente." #: ../Doc/library/unittest.mock.rst:1403 msgid "" -":func:`patch` takes arbitrary keyword arguments. These will be passed to the :" -"class:`Mock` (or *new_callable*) on construction." +":func:`patch` takes arbitrary keyword arguments. These will be passed to " +"the :class:`Mock` (or *new_callable*) on construction." msgstr "" ":func:`patch` toma argumentos por palabra clave arbitrarios. Estos serán " "pasados ​​a :class:`Mock` (o a *new_callable*) durante la construcción." @@ -1561,8 +1570,8 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:1409 msgid "" -":func:`patch` as function decorator, creating the mock for you and passing it " -"into the decorated function::" +":func:`patch` as function decorator, creating the mock for you and passing " +"it into the decorated function::" msgstr "" ":func:`patch` como decorador de función, crea el objeto simulado por ti y lo " "pasa a la función decorada:" @@ -1583,14 +1592,15 @@ msgid "" "side_effect` to return a new mock each time. Alternatively you can set the " "*return_value* to be anything you want." msgstr "" -"Si la clase se instancia en múltiples ocasiones, puedes utilizar el atributo :" -"attr:`~Mock.side_effect` para retornar un nuevo objeto simulado cada vez. O " -"también puedes establecer *return_value* para que sea lo que tu quieras." +"Si la clase se instancia en múltiples ocasiones, puedes utilizar el " +"atributo :attr:`~Mock.side_effect` para retornar un nuevo objeto simulado " +"cada vez. O también puedes establecer *return_value* para que sea lo que tu " +"quieras." #: ../Doc/library/unittest.mock.rst:1427 msgid "" -"To configure return values on methods of *instances* on the patched class you " -"must do this on the :attr:`return_value`. For example::" +"To configure return values on methods of *instances* on the patched class " +"you must do this on the :attr:`return_value`. For example::" msgstr "" "Para configurar valores de retorno de métodos en *instancias* de la clase " "parcheada debes hacer uso del atributo :attr:`return_value`. Por ejemplo:" @@ -1607,33 +1617,34 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:1451 msgid "" "The *new_callable* argument is useful where you want to use an alternative " -"class to the default :class:`MagicMock` for the created mock. For example, if " -"you wanted a :class:`NonCallableMock` to be used::" +"class to the default :class:`MagicMock` for the created mock. For example, " +"if you wanted a :class:`NonCallableMock` to be used::" msgstr "" "El argumento *new_callable* es útil cuando deseas utilizar una clase por " "defecto alternativa a :class:`MagicMock` para el objeto simulado creado. Por " -"ejemplo, si quieres que se use una clase :class:`NonCallableMock` por defecto:" +"ejemplo, si quieres que se use una clase :class:`NonCallableMock` por " +"defecto:" #: ../Doc/library/unittest.mock.rst:1464 msgid "" "Another use case might be to replace an object with an :class:`io.StringIO` " "instance::" msgstr "" -"Otro caso de uso podría ser la sustitución de un objeto por una instancia de :" -"class:`io.StringIO`:" +"Otro caso de uso podría ser la sustitución de un objeto por una instancia " +"de :class:`io.StringIO`:" #: ../Doc/library/unittest.mock.rst:1477 msgid "" "When :func:`patch` is creating a mock for you, it is common that the first " -"thing you need to do is to configure the mock. Some of that configuration can " -"be done in the call to patch. Any arbitrary keywords you pass into the call " -"will be used to set attributes on the created mock::" +"thing you need to do is to configure the mock. Some of that configuration " +"can be done in the call to patch. Any arbitrary keywords you pass into the " +"call will be used to set attributes on the created mock::" msgstr "" -"Cuando :func:`patch` crea un objeto simulado para ti, a menudo lo primero que " -"tienes que hacer es configurar el objeto simulado recién creado. Parte de la " -"configuración se puede hacer en la propia llamada a patch. Cualquier palabra " -"clave arbitraria que pases a la llamada será utilizada para establecer los " -"atributos del objeto simulado creado:" +"Cuando :func:`patch` crea un objeto simulado para ti, a menudo lo primero " +"que tienes que hacer es configurar el objeto simulado recién creado. Parte " +"de la configuración se puede hacer en la propia llamada a patch. Cualquier " +"palabra clave arbitraria que pases a la llamada será utilizada para " +"establecer los atributos del objeto simulado creado:" #: ../Doc/library/unittest.mock.rst:1489 msgid "" @@ -1643,13 +1654,13 @@ msgid "" "arguments, but a dictionary with these as keys can still be expanded into a :" "func:`patch` call using ``**``::" msgstr "" -"Los atributos de los objetos simulados hijos, como :attr:`~Mock.return_value` " -"y :attr:`~Mock.side_effect`, también puede ser configurados en la llamada, " -"dado que los objetos simulados hijos son atributos en si mismos del objeto " -"simulado padre creado. Eso si, estos no son sintácticamente válidos para ser " -"pasados directamente como argumentos por palabras clave a la función patch, " -"pero un diccionario con ellos como claves si que puede ser expandido en una " -"llama a :func:`patch` usando ``**``:" +"Los atributos de los objetos simulados hijos, como :attr:`~Mock." +"return_value` y :attr:`~Mock.side_effect`, también puede ser configurados en " +"la llamada, dado que los objetos simulados hijos son atributos en si mismos " +"del objeto simulado padre creado. Eso si, estos no son sintácticamente " +"válidos para ser pasados directamente como argumentos por palabras clave a " +"la función patch, pero un diccionario con ellos como claves si que puede ser " +"expandido en una llama a :func:`patch` usando ``**``:" #: ../Doc/library/unittest.mock.rst:1505 msgid "" @@ -1666,8 +1677,8 @@ msgid "" "but adding ``create=True`` in the call to :func:`patch` will make the " "previous example work as expected::" msgstr "" -"pero añadir ``create=True`` en la llamada a :func:`patch` hará que el ejemplo " -"previo funcione como se esperaba:" +"pero añadir ``create=True`` en la llamada a :func:`patch` hará que el " +"ejemplo previo funcione como se esperaba:" #: ../Doc/library/unittest.mock.rst:1528 msgid "" @@ -1691,9 +1702,9 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:1539 msgid "" -":func:`patch.object` can be used as a decorator, class decorator or a context " -"manager. Arguments *new*, *spec*, *create*, *spec_set*, *autospec* and " -"*new_callable* have the same meaning as for :func:`patch`. Like :func:" +":func:`patch.object` can be used as a decorator, class decorator or a " +"context manager. Arguments *new*, *spec*, *create*, *spec_set*, *autospec* " +"and *new_callable* have the same meaning as for :func:`patch`. Like :func:" "`patch`, :func:`patch.object` takes arbitrary keyword arguments for " "configuring the mock object it creates." msgstr "" @@ -1709,8 +1720,8 @@ msgid "" "When used as a class decorator :func:`patch.object` honours ``patch." "TEST_PREFIX`` for choosing which methods to wrap." msgstr "" -"Cuando se utiliza como un decorador de clase :func:`patch.object` se rige por " -"``patch.TEST_PREFIX`` a la hora de elegir los métodos a envolver." +"Cuando se utiliza como un decorador de clase :func:`patch.object` se rige " +"por ``patch.TEST_PREFIX`` a la hora de elegir los métodos a envolver." #: ../Doc/library/unittest.mock.rst:1548 msgid "" @@ -1725,8 +1736,8 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:1552 msgid "" "When calling with the two argument form you omit the replacement object, and " -"a mock is created for you and passed in as an extra argument to the decorated " -"function:" +"a mock is created for you and passed in as an extra argument to the " +"decorated function:" msgstr "" "Al llamar usando la variante de dos argumento se omite el objeto de " "sustitución, por lo tanto se crea un objeto simulado automáticamente y se " @@ -1754,12 +1765,12 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:1575 msgid "" -"*in_dict* can be a dictionary or a mapping like container. If it is a mapping " -"then it must at least support getting, setting and deleting items plus " -"iterating over keys." +"*in_dict* can be a dictionary or a mapping like container. If it is a " +"mapping then it must at least support getting, setting and deleting items " +"plus iterating over keys." msgstr "" -"*in_dict* puede ser un diccionario o un contenedor similar a uno. Si se trata " -"de un objeto similar a un diccionario, debe soportar como mínimo el " +"*in_dict* puede ser un diccionario o un contenedor similar a uno. Si se " +"trata de un objeto similar a un diccionario, debe soportar como mínimo el " "establecimiento, la obtención y la eliminación de elementos, además de " "permitir la iteración sobre las claves." @@ -1774,8 +1785,8 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:1582 msgid "" -"*values* can be a dictionary of values to set in the dictionary. *values* can " -"also be an iterable of ``(key, value)`` pairs." +"*values* can be a dictionary of values to set in the dictionary. *values* " +"can also be an iterable of ``(key, value)`` pairs." msgstr "" "*values* puede ser otro diccionario con valores para ser añadidos al " "diccionario. *values* también puede ser un iterable de parejas ``(clave, " @@ -1791,8 +1802,8 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:1588 msgid "" -":func:`patch.dict` can also be called with arbitrary keyword arguments to set " -"values in the dictionary." +":func:`patch.dict` can also be called with arbitrary keyword arguments to " +"set values in the dictionary." msgstr "" "La función :func:`patch.dict` también puede ser llamada con argumentos por " "palabra clave arbitrarios para establecer los valores en el diccionario." @@ -1839,9 +1850,9 @@ msgid "" "a test change a dictionary, and ensure the dictionary is restored when the " "test ends." msgstr "" -":func:`patch.dict` puede utilizarse para agregar miembros a un diccionario, o " -"simplemente para dejar que una prueba modifique un diccionario y asegurarte " -"de que el diccionario será restablecido cuando finalice la misma." +":func:`patch.dict` puede utilizarse para agregar miembros a un diccionario, " +"o simplemente para dejar que una prueba modifique un diccionario y " +"asegurarte de que el diccionario será restablecido cuando finalice la misma." #: ../Doc/library/unittest.mock.rst:1642 msgid "" @@ -1863,8 +1874,8 @@ msgstr "" "que no son realmente diccionarios. Estos objetos como mínimo deben permitir " "obtener, establecer y borrar elementos, además de soportar la iteración o la " "prueba de pertenencia. Dichas funcionalidades se corresponden a los métodos " -"mágicos :meth:`__getitem__`, :meth:`__setitem__`, :meth:`__delitem__` e :meth:" -"`__iter__` o :meth:`__contains__`." +"mágicos :meth:`__getitem__`, :meth:`__setitem__`, :meth:`__delitem__` e :" +"meth:`__iter__` o :meth:`__contains__`." #: ../Doc/library/unittest.mock.rst:1681 msgid "patch.multiple" @@ -1877,16 +1888,16 @@ msgid "" "keyword arguments for the patches::" msgstr "" "Realiza múltiples parches en una sola llamada. Se toma el objeto a ser " -"parcheado (ya sea como un objeto o una cadena de caracteres con el nombre del " -"mismo para obtener el objeto mediante importación) y los argumentos por " +"parcheado (ya sea como un objeto o una cadena de caracteres con el nombre " +"del mismo para obtener el objeto mediante importación) y los argumentos por " "palabras clave para los parches:" #: ../Doc/library/unittest.mock.rst:1692 msgid "" -"Use :data:`DEFAULT` as the value if you want :func:`patch.multiple` to create " -"mocks for you. In this case the created mocks are passed into a decorated " -"function by keyword, and a dictionary is returned when :func:`patch.multiple` " -"is used as a context manager." +"Use :data:`DEFAULT` as the value if you want :func:`patch.multiple` to " +"create mocks for you. In this case the created mocks are passed into a " +"decorated function by keyword, and a dictionary is returned when :func:" +"`patch.multiple` is used as a context manager." msgstr "" "Usa :data:`DEFAULT` como valor si deseas que la función :func:`patch." "multiple` cree objetos simulados automáticamente por ti. En este caso, los " @@ -1903,23 +1914,24 @@ msgid "" msgstr "" "La función :func:`patch.multiple` se puede utilizar como un decorador, " "decorador de clase o como gestor de contexto. La argumentos *spec*, " -"*spec_set*, *create*, *autospec* y *new_callable* tienen el mismo significado " -"que en la función :func:`patch`. Estos argumentos se aplicarán a *todos* los " -"parches realizados por :func:`patch.multiple`." +"*spec_set*, *create*, *autospec* y *new_callable* tienen el mismo " +"significado que en la función :func:`patch`. Estos argumentos se aplicarán a " +"*todos* los parches realizados por :func:`patch.multiple`." #: ../Doc/library/unittest.mock.rst:1702 msgid "" "When used as a class decorator :func:`patch.multiple` honours ``patch." "TEST_PREFIX`` for choosing which methods to wrap." msgstr "" -"Cuando se utiliza como decorador de clase, :func:`patch.multiple` se rige por " -"``patch.TEST_PREFIX`` a la hora de elegir qué métodos envolver." +"Cuando se utiliza como decorador de clase, :func:`patch.multiple` se rige " +"por ``patch.TEST_PREFIX`` a la hora de elegir qué métodos envolver." #: ../Doc/library/unittest.mock.rst:1705 msgid "" -"If you want :func:`patch.multiple` to create mocks for you, then you can use :" -"data:`DEFAULT` as the value. If you use :func:`patch.multiple` as a decorator " -"then the created mocks are passed into the decorated function by keyword. ::" +"If you want :func:`patch.multiple` to create mocks for you, then you can " +"use :data:`DEFAULT` as the value. If you use :func:`patch.multiple` as a " +"decorator then the created mocks are passed into the decorated function by " +"keyword. ::" msgstr "" "Si deseas que :func:`patch.multiple` cree objetos simulados automáticamente " "por ti, puedes utilizar :data:`DEFAULT` como valor. Si utilizas :func:`patch." @@ -1928,9 +1940,9 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:1719 msgid "" -":func:`patch.multiple` can be nested with other ``patch`` decorators, but put " -"arguments passed by keyword *after* any of the standard arguments created by :" -"func:`patch`::" +":func:`patch.multiple` can be nested with other ``patch`` decorators, but " +"put arguments passed by keyword *after* any of the standard arguments " +"created by :func:`patch`::" msgstr "" ":func:`patch.multiple` se puede anidar junto a otros decoradores ``patch``, " "pero los argumentos pasados ​​por palabra clave se deben agregar *después* de " @@ -1938,8 +1950,9 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:1731 msgid "" -"If :func:`patch.multiple` is used as a context manager, the value returned by " -"the context manager is a dictionary where created mocks are keyed by name::" +"If :func:`patch.multiple` is used as a context manager, the value returned " +"by the context manager is a dictionary where created mocks are keyed by " +"name::" msgstr "" "Si :func:`patch.multiple` se utiliza como un gestor de contexto, el valor " "retornado por el mismo es un diccionario en el que los objetos simulados " @@ -1961,14 +1974,15 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:1751 msgid "" -"To use them call :func:`patch`, :func:`patch.object` or :func:`patch.dict` as " -"normal and keep a reference to the returned ``patcher`` object. You can then " -"call :meth:`start` to put the patch in place and :meth:`stop` to undo it." +"To use them call :func:`patch`, :func:`patch.object` or :func:`patch.dict` " +"as normal and keep a reference to the returned ``patcher`` object. You can " +"then call :meth:`start` to put the patch in place and :meth:`stop` to undo " +"it." msgstr "" "Para utilizarlos estos métodos, llama a :func:`patch`, :func:`patch.object` " -"o :func:`patch.dict` como haces normalmente y mantén una referencia al objeto " -"``patcher`` retornado. A continuación, puedes llamar al método :meth:`start` " -"para aplicar el parche y a :meth:`stop` para deshacerlo." +"o :func:`patch.dict` como haces normalmente y mantén una referencia al " +"objeto ``patcher`` retornado. A continuación, puedes llamar al método :meth:" +"`start` para aplicar el parche y a :meth:`stop` para deshacerlo." #: ../Doc/library/unittest.mock.rst:1755 msgid "" @@ -2040,15 +2054,15 @@ msgstr "TEST_PREFIX" #: ../Doc/library/unittest.mock.rst:1838 msgid "" "All of the patchers can be used as class decorators. When used in this way " -"they wrap every test method on the class. The patchers recognise methods that " -"start with ``'test'`` as being test methods. This is the same way that the :" -"class:`unittest.TestLoader` finds test methods by default." +"they wrap every test method on the class. The patchers recognise methods " +"that start with ``'test'`` as being test methods. This is the same way that " +"the :class:`unittest.TestLoader` finds test methods by default." msgstr "" -"Todos los parcheadores se puede utilizar como decoradores de clase. Cuando se " -"usan de esta forma, todos los métodos a probar en la clase son envueltos. Los " -"parcheadores reconocen los métodos que comienzan con ``'test'`` como métodos " -"a probar. Esta es la misma forma que la clase :class:`unittest.TestLoader` " -"usa para encontrar métodos de prueba por defecto." +"Todos los parcheadores se puede utilizar como decoradores de clase. Cuando " +"se usan de esta forma, todos los métodos a probar en la clase son envueltos. " +"Los parcheadores reconocen los métodos que comienzan con ``'test'`` como " +"métodos a probar. Esta es la misma forma que la clase :class:`unittest." +"TestLoader` usa para encontrar métodos de prueba por defecto." #: ../Doc/library/unittest.mock.rst:1843 msgid "" @@ -2092,10 +2106,10 @@ msgstr "Dónde parchear" #: ../Doc/library/unittest.mock.rst:1897 msgid "" -":func:`patch` works by (temporarily) changing the object that a *name* points " -"to with another one. There can be many names pointing to any individual " -"object, so for patching to work you must ensure that you patch the name used " -"by the system under test." +":func:`patch` works by (temporarily) changing the object that a *name* " +"points to with another one. There can be many names pointing to any " +"individual object, so for patching to work you must ensure that you patch " +"the name used by the system under test." msgstr "" ":func:`patch` funciona cambiando (temporalmente) el objeto al que apunta " "*name* con otro. Puede haber muchos nombres apuntando a cualquier objeto " @@ -2132,16 +2146,17 @@ msgstr "" "Ahora queremos probar ``some_function``, pero queremos simular ``SomeClass`` " "utilizando :func:`patch`. El problema es que cuando importamos el módulo b, " "lo cual tenemos que hacer obligatoriamente, se importa ``SomeClass`` del " -"módulo a. Si utilizamos :func:`patch` para simular ``a.SomeClass``, no tendrá " -"ningún efecto en nuestra prueba; el módulo b ya tiene una referencia a la " -"``SomeClass`` *real*, por lo que parece que nuestro parcheo no tuvo ningún " -"efecto." +"módulo a. Si utilizamos :func:`patch` para simular ``a.SomeClass``, no " +"tendrá ningún efecto en nuestra prueba; el módulo b ya tiene una referencia " +"a la ``SomeClass`` *real*, por lo que parece que nuestro parcheo no tuvo " +"ningún efecto." #: ../Doc/library/unittest.mock.rst:1922 msgid "" -"The key is to patch out ``SomeClass`` where it is used (or where it is looked " -"up). In this case ``some_function`` will actually look up ``SomeClass`` in " -"module b, where we have imported it. The patching should look like::" +"The key is to patch out ``SomeClass`` where it is used (or where it is " +"looked up). In this case ``some_function`` will actually look up " +"``SomeClass`` in module b, where we have imported it. The patching should " +"look like::" msgstr "" "La clave es parchear ``SomeClass`` donde se utiliza (o donde es buscado). En " "este caso ``some_function`` realmente va a buscar ``SomeClass`` en el módulo " @@ -2151,15 +2166,15 @@ msgstr "" msgid "" "However, consider the alternative scenario where instead of ``from a import " "SomeClass`` module b does ``import a`` and ``some_function`` uses ``a." -"SomeClass``. Both of these import forms are common. In this case the class we " -"want to patch is being looked up in the module and so we have to patch ``a." -"SomeClass`` instead::" +"SomeClass``. Both of these import forms are common. In this case the class " +"we want to patch is being looked up in the module and so we have to patch " +"``a.SomeClass`` instead::" msgstr "" "Sin embargo, ten en cuenta el escenario alternativo donde en el módulo b en " -"lugar de ``from a import SomeClass`` se hace ``import a`` y ``some_function`` " -"usa ``a.SomeClass``. Ambas formas de importación son comunes. En este caso, " -"la clase que queremos parchear está siendo buscada en el módulo, por lo que " -"tenemos que parchear ``a.SomeClass``:" +"lugar de ``from a import SomeClass`` se hace ``import a`` y " +"``some_function`` usa ``a.SomeClass``. Ambas formas de importación son " +"comunes. En este caso, la clase que queremos parchear está siendo buscada en " +"el módulo, por lo que tenemos que parchear ``a.SomeClass``:" #: ../Doc/library/unittest.mock.rst:1937 msgid "Patching Descriptors and Proxy Objects" @@ -2168,17 +2183,17 @@ msgstr "Parcheando descriptores y objetos proxy" #: ../Doc/library/unittest.mock.rst:1939 msgid "" "Both patch_ and patch.object_ correctly patch and restore descriptors: class " -"methods, static methods and properties. You should patch these on the *class* " -"rather than an instance. They also work with *some* objects that proxy " -"attribute access, like the `django settings object `_." +"methods, static methods and properties. You should patch these on the " +"*class* rather than an instance. They also work with *some* objects that " +"proxy attribute access, like the `django settings object `_." msgstr "" "Tanto patch_ como patch.object_ parchean descriptores correctamente y los " "restauran posteriormente: métodos de clase, métodos estáticos y propiedades. " "Los descriptores deben ser parcheados en la *clase* y no en una instancia. " "También funcionan con *algunos* objetos que actúan como proxy en el acceso a " -"atributos, como `los objetos de configuración de django `_." +"atributos, como `los objetos de configuración de django `_." #: ../Doc/library/unittest.mock.rst:1947 msgid "MagicMock and magic method support" @@ -2208,8 +2223,8 @@ msgid "" msgstr "" "Dado que los métodos mágicos se buscan de manera diferente a los métodos " "normales [#]_, este soporte ha sido especialmente implementado. Esto " -"significa que sólo es compatible con métodos mágicos específicos. La lista de " -"métodos soportados incluye *casi* todos los existentes. Si hay alguno que " +"significa que sólo es compatible con métodos mágicos específicos. La lista " +"de métodos soportados incluye *casi* todos los existentes. Si hay alguno que " "falta y que consideras necesario, por favor háznoslo saber." #: ../Doc/library/unittest.mock.rst:1963 @@ -2218,9 +2233,9 @@ msgid "" "function or a mock instance. If you are using a function then it *must* take " "``self`` as the first argument [#]_." msgstr "" -"Puedes simular métodos mágicos estableciendo el método que te interesa en una " -"función o en una instancia simulada. Si utilizas una función, *debe* aceptar " -"``self`` como primer argumento [#]_." +"Puedes simular métodos mágicos estableciendo el método que te interesa en " +"una función o en una instancia simulada. Si utilizas una función, *debe* " +"aceptar ``self`` como primer argumento [#]_." #: ../Doc/library/unittest.mock.rst:1986 msgid "" @@ -2241,7 +2256,8 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:2003 msgid "" "If you use the *spec* keyword argument to create a mock then attempting to " -"set a magic method that isn't in the spec will raise an :exc:`AttributeError`." +"set a magic method that isn't in the spec will raise an :exc:" +"`AttributeError`." msgstr "" "Si se utiliza el argumento por palabra clave *spec* para crear un objeto " "simulado, intentar después establecer un método mágico que no está en la " @@ -2283,7 +2299,8 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:2016 msgid "" -"Context manager: ``__enter__``, ``__exit__``, ``__aenter__`` and ``__aexit__``" +"Context manager: ``__enter__``, ``__exit__``, ``__aenter__`` and " +"``__aexit__``" msgstr "" "Administrador de contexto: ``__enter__``, ``__exit__``, ``__aenter__`` y " "``__aexit__``" @@ -2311,8 +2328,8 @@ msgid "" "Numeric conversion methods: ``__complex__``, ``__int__``, ``__float__`` and " "``__index__``" msgstr "" -"Métodos de conversión numérica: ``__complex__``, ``__int__``, ``__float__`` y " -"``__index__``" +"Métodos de conversión numérica: ``__complex__``, ``__int__``, ``__float__`` " +"y ``__index__``" #: ../Doc/library/unittest.mock.rst:2024 msgid "Descriptor methods: ``__get__``, ``__set__`` and ``__delete__``" @@ -2348,8 +2365,8 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:2037 msgid "" -"The following methods exist but are *not* supported as they are either in use " -"by mock, can't be set dynamically, or can cause problems:" +"The following methods exist but are *not* supported as they are either in " +"use by mock, can't be set dynamically, or can cause problems:" msgstr "" "Los siguientes métodos existen pero *no* están soportados, ya sea porque son " "usados por el propio objeto simulado, porque no se pueden establecer " @@ -2385,8 +2402,8 @@ msgid "" msgstr "" "``MagicMock`` es una subclase de :class:`Mock` con implementaciones por " "defecto de la mayoría de los métodos mágicos. Puedes utilizar ``MagicMock`` " -"para crear objetos simulados sin tener que establecer los métodos mágicos por " -"ti mismo." +"para crear objetos simulados sin tener que establecer los métodos mágicos " +"por ti mismo." #: ../Doc/library/unittest.mock.rst:2057 msgid "The constructor parameters have the same meaning as for :class:`Mock`." @@ -2413,8 +2430,8 @@ msgid "" "on a non-callable mock." msgstr "" "Los parámetros del constructor tienen el mismo significado que en :class:" -"`MagicMock`, con la excepción de *return_value* y *side_effect* que no tienen " -"significado en un objeto simulado no invocable." +"`MagicMock`, con la excepción de *return_value* y *side_effect* que no " +"tienen significado en un objeto simulado no invocable." #: ../Doc/library/unittest.mock.rst:2071 msgid "" @@ -2429,8 +2446,8 @@ msgid "" "By default many of the protocol methods are required to return objects of a " "specific type. These methods are preconfigured with a default return value, " "so that they can be used without you having to do anything if you aren't " -"interested in the return value. You can still *set* the return value manually " -"if you want to change the default." +"interested in the return value. You can still *set* the return value " +"manually if you want to change the default." msgstr "" "Por defecto, muchos de los métodos de protocolo están obligados a retornar " "objetos de un tipo específico. Estos métodos están preconfigurados con un " @@ -2522,15 +2539,15 @@ msgid "" "side_effect` attribute, unless you change their return value to return " "something else::" msgstr "" -"Los dos métodos de igualdad, :meth:`__eq__` y :meth:`__ne__`, son especiales. " -"Realizan la comparación de igualdad predeterminada basada en la identidad, " -"utilizando el atributo :attr:`~Mock.side_effect`, a menos que cambies su " -"valor de retorno para que retorne alguna otra cosa:" +"Los dos métodos de igualdad, :meth:`__eq__` y :meth:`__ne__`, son " +"especiales. Realizan la comparación de igualdad predeterminada basada en la " +"identidad, utilizando el atributo :attr:`~Mock.side_effect`, a menos que " +"cambies su valor de retorno para que retorne alguna otra cosa:" #: ../Doc/library/unittest.mock.rst:2133 msgid "" -"The return value of :meth:`MagicMock.__iter__` can be any iterable object and " -"isn't required to be an iterator:" +"The return value of :meth:`MagicMock.__iter__` can be any iterable object " +"and isn't required to be an iterator:" msgstr "" "El valor de retorno de :meth:`MagicMock.__iter__` puede ser cualquier objeto " "iterable, no se requiere que sea un iterador:" @@ -2546,7 +2563,8 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:2152 msgid "" "``MagicMock`` has all of the supported magic methods configured except for " -"some of the obscure and obsolete ones. You can still set these up if you want." +"some of the obscure and obsolete ones. You can still set these up if you " +"want." msgstr "" "``MagicMock`` tiene todos los métodos mágicos soportados configurados a " "excepción de algunos de los más oscuros y obsoletos. De todas formas, puedes " @@ -2621,8 +2639,8 @@ msgstr "sentinel" #: ../Doc/library/unittest.mock.rst:2184 msgid "" -"The ``sentinel`` object provides a convenient way of providing unique objects " -"for your tests." +"The ``sentinel`` object provides a convenient way of providing unique " +"objects for your tests." msgstr "" "El objeto ``sentinel`` proporciona una manera conveniente de proporcionar " "objetos únicos para tus pruebas." @@ -2661,7 +2679,8 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:2200 msgid "" -"In this example we monkey patch ``method`` to return ``sentinel.some_object``:" +"In this example we monkey patch ``method`` to return ``sentinel." +"some_object``:" msgstr "" "En el siguiente ejemplo, parcheamos ``method`` para retornar ``sentinel." "some_object``:" @@ -2673,8 +2692,8 @@ msgstr "DEFAULT" #: ../Doc/library/unittest.mock.rst:2217 msgid "" "The :data:`DEFAULT` object is a pre-created sentinel (actually ``sentinel." -"DEFAULT``). It can be used by :attr:`~Mock.side_effect` functions to indicate " -"that the normal return value should be used." +"DEFAULT``). It can be used by :attr:`~Mock.side_effect` functions to " +"indicate that the normal return value should be used." msgstr "" "El objeto :data:`DEFAULT` es un centinela pre-creado (actualmente ``sentinel." "DEFAULT``). Puede ser usado por las funciones :attr:`~Mock.side_effect` para " @@ -2693,17 +2712,17 @@ msgid "" msgstr "" ":func:`call` es un objeto ayudante que puede usarse para hacer aserciones " "simples, para comparar con :attr:`~Mock.call_args`, :attr:`~Mock." -"call_args_list`, :attr:`~Mock.mock_calls` y :attr:`~Mock.method_calls`. :func:" -"`call` y también se puede utilizar con :meth:`~Mock.assert_has_calls`." +"call_args_list`, :attr:`~Mock.mock_calls` y :attr:`~Mock.method_calls`. :" +"func:`call` y también se puede utilizar con :meth:`~Mock.assert_has_calls`." #: ../Doc/library/unittest.mock.rst:2240 msgid "" -"For a call object that represents multiple calls, :meth:`call_list` returns a " -"list of all the intermediate calls as well as the final call." +"For a call object that represents multiple calls, :meth:`call_list` returns " +"a list of all the intermediate calls as well as the final call." msgstr "" "Para un objeto call que representa múltiples llamadas, el método :meth:" -"`call_list` retorna una lista con todas las llamadas intermedias, así como la " -"llamada final." +"`call_list` retorna una lista con todas las llamadas intermedias, así como " +"la llamada final." #: ../Doc/library/unittest.mock.rst:2244 msgid "" @@ -2713,8 +2732,8 @@ msgid "" "constructing the sequence of calls can be tedious." msgstr "" "``call_list`` es particularmente útil para hacer aserciones sobre \"llamadas " -"encadenadas\". Una llamada encadenada es varias llamadas en una sola línea de " -"código. Esto resulta en múltiples entradas en el atributo :attr:`~Mock." +"encadenadas\". Una llamada encadenada es varias llamadas en una sola línea " +"de código. Esto resulta en múltiples entradas en el atributo :attr:`~Mock." "mock_calls` de un objeto simulado. Construir manualmente la secuencia de " "llamadas puede ser tedioso." @@ -2730,26 +2749,27 @@ msgstr "" msgid "" "A ``call`` object is either a tuple of (positional args, keyword args) or " "(name, positional args, keyword args) depending on how it was constructed. " -"When you construct them yourself this isn't particularly interesting, but the " -"``call`` objects that are in the :attr:`Mock.call_args`, :attr:`Mock." -"call_args_list` and :attr:`Mock.mock_calls` attributes can be introspected to " -"get at the individual arguments they contain." -msgstr "" -"Un objeto ``call``, dependiendo de cómo fuera construido, puede ser una tupla " -"de la forma (argumentos posicionales, argumentos por palabras clave) o bien " -"de la forma (nombre, argumentos posicionales, argumentos por palabras clave). " -"Esto no es particularmente interesante cuando los construyes por ti mismo, " -"pero la introspección de los objetos ``call`` que conforman los atributos :" -"attr:`Mock.call_args`, :attr:`Mock.call_args_list` y :attr:`Mock.mock_calls` " -"si pueden ser de utilidad para para acceder a los argumentos individuales que " -"contienen." +"When you construct them yourself this isn't particularly interesting, but " +"the ``call`` objects that are in the :attr:`Mock.call_args`, :attr:`Mock." +"call_args_list` and :attr:`Mock.mock_calls` attributes can be introspected " +"to get at the individual arguments they contain." +msgstr "" +"Un objeto ``call``, dependiendo de cómo fuera construido, puede ser una " +"tupla de la forma (argumentos posicionales, argumentos por palabras clave) o " +"bien de la forma (nombre, argumentos posicionales, argumentos por palabras " +"clave). Esto no es particularmente interesante cuando los construyes por ti " +"mismo, pero la introspección de los objetos ``call`` que conforman los " +"atributos :attr:`Mock.call_args`, :attr:`Mock.call_args_list` y :attr:`Mock." +"mock_calls` si pueden ser de utilidad para para acceder a los argumentos " +"individuales que contienen." #: ../Doc/library/unittest.mock.rst:2273 msgid "" "The ``call`` objects in :attr:`Mock.call_args` and :attr:`Mock." -"call_args_list` are two-tuples of (positional args, keyword args) whereas the " -"``call`` objects in :attr:`Mock.mock_calls`, along with ones you construct " -"yourself, are three-tuples of (name, positional args, keyword args)." +"call_args_list` are two-tuples of (positional args, keyword args) whereas " +"the ``call`` objects in :attr:`Mock.mock_calls`, along with ones you " +"construct yourself, are three-tuples of (name, positional args, keyword " +"args)." msgstr "" "Los objetos ``call`` en :attr:`Mock.call_args` y :attr:`Mock.call_args_list` " "están conformados por dos tuplas (argumentos posicionales, argumentos por " @@ -2759,15 +2779,15 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:2278 msgid "" -"You can use their \"tupleness\" to pull out the individual arguments for more " -"complex introspection and assertions. The positional arguments are a tuple " -"(an empty tuple if there are no positional arguments) and the keyword " +"You can use their \"tupleness\" to pull out the individual arguments for " +"more complex introspection and assertions. The positional arguments are a " +"tuple (an empty tuple if there are no positional arguments) and the keyword " "arguments are a dictionary:" msgstr "" "Puedes utilizar esta presentación en forma de tuplas para obtener los " "argumentos individuales, con la finalidad de llevar a cabo introspección y " -"aserciones más complejas. Los argumentos posicionales son una tupla (vacía si " -"no hay ninguno) y los argumentos por palabra clave son un diccionario:" +"aserciones más complejas. Los argumentos posicionales son una tupla (vacía " +"si no hay ninguno) y los argumentos por palabra clave son un diccionario:" #: ../Doc/library/unittest.mock.rst:2311 msgid "create_autospec" @@ -2784,8 +2804,8 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:2319 msgid "" -"Functions or methods being mocked will have their arguments checked to ensure " -"that they are called with the correct signature." +"Functions or methods being mocked will have their arguments checked to " +"ensure that they are called with the correct signature." msgstr "" "Los argumentos de las funciones o métodos simulados se validarán para " "asegurarse de que son llamados con la firma correcta." @@ -2801,13 +2821,13 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:2325 msgid "" "If a class is used as a spec then the return value of the mock (the instance " -"of the class) will have the same spec. You can use a class as the spec for an " -"instance object by passing ``instance=True``. The returned mock will only be " -"callable if instances of the mock are callable." +"of the class) will have the same spec. You can use a class as the spec for " +"an instance object by passing ``instance=True``. The returned mock will only " +"be callable if instances of the mock are callable." msgstr "" -"Si se utilizada una clase como especificación, el valor de retorno del objeto " -"simulado (la instancia de la clase) tendrá la misma especificación. Se puede " -"utilizar una clase como especificación de una instancia pasando " +"Si se utilizada una clase como especificación, el valor de retorno del " +"objeto simulado (la instancia de la clase) tendrá la misma especificación. " +"Se puede utilizar una clase como especificación de una instancia pasando " "``instance=True``. El objeto simulado retornado sólo será invocable si las " "instancias del objeto simulado son también invocables." @@ -2825,13 +2845,13 @@ msgid "" "`create_autospec` and the *autospec* argument to :func:`patch`." msgstr "" "Consultar :ref:`auto-speccing` para ver ejemplos de cómo utilizar la " -"autoespecificación mediante :func:`create_autospec` y el argumento *autospec* " -"de :func:`patch`." +"autoespecificación mediante :func:`create_autospec` y el argumento " +"*autospec* de :func:`patch`." #: ../Doc/library/unittest.mock.rst:2339 msgid "" -":func:`create_autospec` now returns an :class:`AsyncMock` if the target is an " -"async function." +":func:`create_autospec` now returns an :class:`AsyncMock` if the target is " +"an async function." msgstr "" ":func:`create_autospec` ahora retorna un objeto :class:`AsyncMock` si el " "objetivo a simular es una función asíncrona." @@ -2843,8 +2863,8 @@ msgstr "ANY" #: ../Doc/library/unittest.mock.rst:2348 msgid "" "Sometimes you may need to make assertions about *some* of the arguments in a " -"call to mock, but either not care about some of the arguments or want to pull " -"them individually out of :attr:`~Mock.call_args` and make more complex " +"call to mock, but either not care about some of the arguments or want to " +"pull them individually out of :attr:`~Mock.call_args` and make more complex " "assertions on them." msgstr "" "A veces puede que necesites hacer aserciones sobre *algunos* de los " @@ -2860,13 +2880,13 @@ msgid "" msgstr "" "Para ignorar ciertos argumentos puedes pasar objetos que se comparan como " "iguales con *cualquier cosa*. En este caso, las llamadas a :meth:`~Mock." -"assert_called_with` y :meth:`~Mock.assert_called_once_with` tendrán éxito sin " -"importar lo que se haya pasado realmente." +"assert_called_with` y :meth:`~Mock.assert_called_once_with` tendrán éxito " +"sin importar lo que se haya pasado realmente." #: ../Doc/library/unittest.mock.rst:2362 msgid "" -":data:`ANY` can also be used in comparisons with call lists like :attr:`~Mock." -"mock_calls`:" +":data:`ANY` can also be used in comparisons with call lists like :attr:" +"`~Mock.mock_calls`:" msgstr "" ":data:`ANY` también se puede utilizar en las comparaciones con las listas de " "llamadas, como :attr:`~Mock.mock_calls`:" @@ -2883,8 +2903,8 @@ msgid "" "useful members. If you dislike this filtering, or need to switch it off for " "diagnostic purposes, then set ``mock.FILTER_DIR = False``." msgstr "" -":data:`FILTER_DIR` es una variable definida a nivel de módulo que controla la " -"forma en la que los objetos simulados responden a :func:`dir` (sólo para " +":data:`FILTER_DIR` es una variable definida a nivel de módulo que controla " +"la forma en la que los objetos simulados responden a :func:`dir` (sólo para " "Python 2.6 y en adelante). El valor predeterminado es ``True``, que utiliza " "el filtrado descrito a continuación, con la finalidad de mostrar solo los " "miembros considerados como útiles. Si no te gusta este filtrado, o necesitas " @@ -2899,11 +2919,11 @@ msgid "" "attributes from the original are shown, even if they haven't been accessed " "yet:" msgstr "" -"Con el filtrado activado, ``dir(some_mock)`` mostrará solo atributos útiles y " -"además incluirá cualquier atributo creado dinámicamente, que normalmente no " -"se mostraría. Si el objeto simulado fue creado con un *spec* (o *autospec*) " -"se muestran todos los atributos del objeto original, incluso si no se ha " -"accedido a ellos todavía:" +"Con el filtrado activado, ``dir(some_mock)`` mostrará solo atributos útiles " +"y además incluirá cualquier atributo creado dinámicamente, que normalmente " +"no se mostraría. Si el objeto simulado fue creado con un *spec* (o " +"*autospec*) se muestran todos los atributos del objeto original, incluso si " +"no se ha accedido a ellos todavía:" #: ../Doc/library/unittest.mock.rst:2412 msgid "" @@ -2916,8 +2936,9 @@ msgstr "" "Muchos de los atributos con subrayado y doble subrayado no muy útiles " "(atributos privados de :class:`Mock` y no del objeto real que se está " "simulando) se han filtrado del resultado de llamar a :func:`dir` en un " -"objeto :class:`Mock`. Si no te gusta este comportamiento, puedes desactivarlo " -"estableciendo el modificador a nivel de módulo :data:`FILTER_DIR`:" +"objeto :class:`Mock`. Si no te gusta este comportamiento, puedes " +"desactivarlo estableciendo el modificador a nivel de módulo :data:" +"`FILTER_DIR`:" #: ../Doc/library/unittest.mock.rst:2433 msgid "" @@ -2939,8 +2960,8 @@ msgid "" "works for :func:`open` called directly or used as a context manager." msgstr "" "Una función auxiliar para un objeto simulado con la finalidad de reemplazar " -"el uso de :func:`open`. Funciona tanto para la llamada directa a :func:`open` " -"como utilizado como gestor de contexto." +"el uso de :func:`open`. Funciona tanto para la llamada directa a :func:" +"`open` como utilizado como gestor de contexto." #: ../Doc/library/unittest.mock.rst:2446 msgid "" @@ -2972,8 +2993,9 @@ msgstr "" "hasta el principio. Si necesitas más control sobre los datos que estás " "proporcionando al código de prueba tendrás que personalizar el objeto " "simulado. Cuando eso no sea suficiente, alguno de los paquetes que " -"implementan sistemas de archivos en memoria disponible en `PyPI `_ puede ofrecer un sistema de archivos realista para usar en las pruebas." +"implementan sistemas de archivos en memoria disponible en `PyPI `_ puede ofrecer un sistema de archivos realista para usar en las " +"pruebas." #: ../Doc/library/unittest.mock.rst:2460 msgid "" @@ -2982,8 +3004,8 @@ msgid "" "than returning it on each call." msgstr "" "Añadido soporte para :meth:`~io.IOBase.readline` y :meth:`~io.IOBase." -"readlines`. El objeto simulado de :meth:`~io.IOBase.read` ahora consume datos " -"de *read_data*, en lugar de retornarlo en cada llamada." +"readlines`. El objeto simulado de :meth:`~io.IOBase.read` ahora consume " +"datos de *read_data*, en lugar de retornarlo en cada llamada." #: ../Doc/library/unittest.mock.rst:2465 msgid "*read_data* is now reset on each call to the *mock*." @@ -3013,8 +3035,8 @@ msgid "" "`__enter__` and :meth:`__exit__` called)." msgstr "" "El problema es que, incluso si simulas la llamada a :func:`open`, es el " -"*objeto retornado* el que se utiliza como gestor de contexto (lo que conlleva " -"que sus métodos :meth:`__enter__` y :meth:`__exit__` son llamados)." +"*objeto retornado* el que se utiliza como gestor de contexto (lo que " +"conlleva que sus métodos :meth:`__enter__` y :meth:`__exit__` son llamados)." #: ../Doc/library/unittest.mock.rst:2482 msgid "" @@ -3034,20 +3056,20 @@ msgstr "Autoespecificación" #: ../Doc/library/unittest.mock.rst:2514 msgid "" -"Autospeccing is based on the existing :attr:`spec` feature of mock. It limits " -"the api of mocks to the api of an original object (the spec), but it is " -"recursive (implemented lazily) so that attributes of mocks only have the same " -"api as the attributes of the spec. In addition mocked functions / methods " -"have the same call signature as the original so they raise a :exc:`TypeError` " -"if they are called incorrectly." +"Autospeccing is based on the existing :attr:`spec` feature of mock. It " +"limits the api of mocks to the api of an original object (the spec), but it " +"is recursive (implemented lazily) so that attributes of mocks only have the " +"same api as the attributes of the spec. In addition mocked functions / " +"methods have the same call signature as the original so they raise a :exc:" +"`TypeError` if they are called incorrectly." msgstr "" "La autoespecificación se basa en la característica :attr:`spec` ya existente " "en el objeto simulado. Limita la API de los objetos simulados a la API del " -"objeto original (la especificación), pero es recursiva (implementada de forma " -"perezosa), de modo que los atributos del objeto simulado sólo tienen la misma " -"API que los atributos de la especificación. Además, las funciones / métodos " -"simuladas tienen la misma firma de llamada que la original y lanzan una " -"excepción :exc:`TypeError` si se les llama incorrectamente." +"objeto original (la especificación), pero es recursiva (implementada de " +"forma perezosa), de modo que los atributos del objeto simulado sólo tienen " +"la misma API que los atributos de la especificación. Además, las funciones / " +"métodos simuladas tienen la misma firma de llamada que la original y lanzan " +"una excepción :exc:`TypeError` si se les llama incorrectamente." #: ../Doc/library/unittest.mock.rst:2521 msgid "Before I explain how auto-speccing works, here's why it is needed." @@ -3057,10 +3079,10 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:2523 msgid "" -":class:`Mock` is a very powerful and flexible object, but it suffers from two " -"flaws when used to mock out objects from a system under test. One of these " -"flaws is specific to the :class:`Mock` api and the other is a more general " -"problem with using mock objects." +":class:`Mock` is a very powerful and flexible object, but it suffers from " +"two flaws when used to mock out objects from a system under test. One of " +"these flaws is specific to the :class:`Mock` api and the other is a more " +"general problem with using mock objects." msgstr "" ":class:`Mock` es un objeto muy potente y flexible, pero adolece de dos " "defectos cuando se utiliza para simular objetos de un sistema bajo prueba. " @@ -3102,30 +3124,30 @@ msgid "" "means your tests can all pass even though your code is broken." msgstr "" "El segundo problema es algo más general en las simulaciones. Si refactorizas " -"parte de tu código, cambias el nombre de los miembros, etc., las pruebas para " -"el código que siguen utilizando la *antigua API*, pero utilizan objetos " +"parte de tu código, cambias el nombre de los miembros, etc., las pruebas " +"para el código que siguen utilizando la *antigua API*, pero utilizan objetos " "simulados en lugar de los objetos reales, todavía pasarán las pruebas. Esto " -"significa que tus pruebas pueden validarlo todo sin problemas, a pesar de que " -"el código esté roto." +"significa que tus pruebas pueden validarlo todo sin problemas, a pesar de " +"que el código esté roto." #: ../Doc/library/unittest.mock.rst:2558 msgid "" "Note that this is another reason why you need integration tests as well as " -"unit tests. Testing everything in isolation is all fine and dandy, but if you " -"don't test how your units are \"wired together\" there is still lots of room " -"for bugs that tests might have caught." +"unit tests. Testing everything in isolation is all fine and dandy, but if " +"you don't test how your units are \"wired together\" there is still lots of " +"room for bugs that tests might have caught." msgstr "" "Ten en cuenta que esta es otra razón por la que necesitas pruebas de " "integración además de pruebas unitarias. Probar todo de forma aislada está " -"muy bien, pero si no pruebas cómo están \"conectadas entre sí\" tus unidades, " -"todavía hay mucho espacio para errores que las pruebas deberían haber " -"detectado." +"muy bien, pero si no pruebas cómo están \"conectadas entre sí\" tus " +"unidades, todavía hay mucho espacio para errores que las pruebas deberían " +"haber detectado." #: ../Doc/library/unittest.mock.rst:2563 msgid "" -":mod:`mock` already provides a feature to help with this, called speccing. If " -"you use a class or instance as the :attr:`spec` for a mock then you can only " -"access attributes on the mock that exist on the real class:" +":mod:`mock` already provides a feature to help with this, called speccing. " +"If you use a class or instance as the :attr:`spec` for a mock then you can " +"only access attributes on the mock that exist on the real class:" msgstr "" ":mod:`mock` ya proporciona una característica para ayudar con esto, llamada " "especificación. Si se utiliza una clase o instancia como atributo :attr:" @@ -3145,17 +3167,17 @@ msgid "" "Auto-speccing solves this problem. You can either pass ``autospec=True`` to :" "func:`patch` / :func:`patch.object` or use the :func:`create_autospec` " "function to create a mock with a spec. If you use the ``autospec=True`` " -"argument to :func:`patch` then the object that is being replaced will be used " -"as the spec object. Because the speccing is done \"lazily\" (the spec is " -"created as attributes on the mock are accessed) you can use it with very " +"argument to :func:`patch` then the object that is being replaced will be " +"used as the spec object. Because the speccing is done \"lazily\" (the spec " +"is created as attributes on the mock are accessed) you can use it with very " "complex or deeply nested objects (like modules that import modules that " "import modules) without a big performance hit." msgstr "" "La autoespecificación resuelve este problema. Puedes pasar ``autospec=True`` " "a :func:`patch` / :func:`patch.object` o utilizar la función :func:" "`create_autospec` para crear un objeto simulado con una especificación. Si " -"utilizas el argumento ``autospec=True`` de :func:`patch`, el objeto que se va " -"a reemplazar se utiliza como objeto de especificación. Debido a que la " +"utilizas el argumento ``autospec=True`` de :func:`patch`, el objeto que se " +"va a reemplazar se utiliza como objeto de especificación. Debido a que la " "especificación se hace \"perezosamente\" (la especificación se crea en el " "instante en el que se accede a los atributos del objeto simulado, no antes), " "se puede utilizar con objetos muy complejos o anidadas (como módulos que " @@ -3173,8 +3195,9 @@ msgid "" "Here's what happens if we try to call it incorrectly::" msgstr "" "Se puede ver que :class:`request.Request` tiene una especificación. :class:" -"`request.Request` toma dos argumentos en el constructor (uno de los cuales es " -"*self*). Esto es lo que sucede si tratamos de llamarlo de forma incorrecta:" +"`request.Request` toma dos argumentos en el constructor (uno de los cuales " +"es *self*). Esto es lo que sucede si tratamos de llamarlo de forma " +"incorrecta:" #: ../Doc/library/unittest.mock.rst:2611 msgid "" @@ -3187,13 +3210,15 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:2618 msgid "" ":class:`Request` objects are not callable, so the return value of " -"instantiating our mocked out :class:`request.Request` is a non-callable mock. " -"With the spec in place any typos in our asserts will raise the correct error::" +"instantiating our mocked out :class:`request.Request` is a non-callable " +"mock. With the spec in place any typos in our asserts will raise the correct " +"error::" msgstr "" "Los objetos de la clase :class:`Request` no son invocables, por lo que el " "valor de retorno de una instancia de nuestro objeto simulado de :class:" "`request.Request` no es invocable. Con la especificación, en cambio, " -"cualquier error tipográfico en nuestras aserciones generará el error correcto:" +"cualquier error tipográfico en nuestras aserciones generará el error " +"correcto:" #: ../Doc/library/unittest.mock.rst:2630 msgid "" @@ -3210,8 +3235,8 @@ msgid "" "As well as using *autospec* through :func:`patch` there is a :func:" "`create_autospec` for creating autospecced mocks directly:" msgstr "" -"Además de poder usar *autospec* a través de :func:`patch`, existe la función :" -"func:`create_autospec` para crear directamente objetos simulados " +"Además de poder usar *autospec* a través de :func:`patch`, existe la " +"función :func:`create_autospec` para crear directamente objetos simulados " "autoespecificados:" #: ../Doc/library/unittest.mock.rst:2642 @@ -3221,20 +3246,20 @@ msgid "" "spec object, autospec has to introspect (access attributes) the spec. As you " "traverse attributes on the mock a corresponding traversal of the original " "object is happening under the hood. If any of your specced objects have " -"properties or descriptors that can trigger code execution then you may not be " -"able to use autospec. On the other hand it is much better to design your " +"properties or descriptors that can trigger code execution then you may not " +"be able to use autospec. On the other hand it is much better to design your " "objects so that introspection is safe [#]_." msgstr "" "Sin embargo, este no es el comportamiento predeterminado, ya que no está " "exento de advertencias y restricciones. Con el fin de conocer que atributos " "están disponibles en el objeto especificado, autospec tiene que hacer uso de " -"introspección sobre la especificación (acceder a los atributos). A medida que " -"recorres los atributos en el objeto simulado, se produce paralelamente y de " -"forma soterrada un recorrido del objeto original. Si alguno de tus objetos " -"especificados tienen propiedades o descriptores que puedan desencadenar la " -"ejecución de código, quizás no deberías utilizar la autoespecificación. De " -"todas formas, es siempre mucho mejor diseñar tus objetos de modo que la " -"introspección sea segura [#]_." +"introspección sobre la especificación (acceder a los atributos). A medida " +"que recorres los atributos en el objeto simulado, se produce paralelamente y " +"de forma soterrada un recorrido del objeto original. Si alguno de tus " +"objetos especificados tienen propiedades o descriptores que puedan " +"desencadenar la ejecución de código, quizás no deberías utilizar la " +"autoespecificación. De todas formas, es siempre mucho mejor diseñar tus " +"objetos de modo que la introspección sea segura [#]_." #: ../Doc/library/unittest.mock.rst:2651 msgid "" @@ -3284,10 +3309,10 @@ msgid "" msgstr "" "Probablemente la mejor manera de resolver el problema es añadir atributos de " "clase como valores por defecto para los miembros de instancia inicializados " -"en el método :meth:`__init__`. Ten en cuenta que, si sólo estás estableciendo " -"atributos predeterminados en :meth:`__init__`, proporcionarlos a través de " -"atributos de clase (que , por supuesto, son compartidos entre instancias) " -"también es más rápido." +"en el método :meth:`__init__`. Ten en cuenta que, si sólo estás " +"estableciendo atributos predeterminados en :meth:`__init__`, proporcionarlos " +"a través de atributos de clase (que , por supuesto, son compartidos entre " +"instancias) también es más rápido." #: ../Doc/library/unittest.mock.rst:2702 msgid "" @@ -3296,15 +3321,15 @@ msgid "" "type. ``None`` would be useless as a spec because it wouldn't let you access " "*any* attributes or methods on it. As ``None`` is *never* going to be useful " "as a spec, and probably indicates a member that will normally of some other " -"type, autospec doesn't use a spec for members that are set to ``None``. These " -"will just be ordinary mocks (well - MagicMocks):" +"type, autospec doesn't use a spec for members that are set to ``None``. " +"These will just be ordinary mocks (well - MagicMocks):" msgstr "" "Esto nos plantea otro problema. Es relativamente común proporcionar un valor " "predeterminado de ``None`` para los miembros que posteriormente se " "convertirán en objetos de un tipo diferente. ``None`` es inútil como " -"especificación dado que no permite acceder a *ningún* atributo o método. Como " -"``None`` *nunca* será útil como especificación, y probablemente indica un " -"miembro que normalmente será de algún otro tipo en el futuro, la " +"especificación dado que no permite acceder a *ningún* atributo o método. " +"Como ``None`` *nunca* será útil como especificación, y probablemente indica " +"un miembro que normalmente será de algún otro tipo en el futuro, la " "autoespecificación no usa una especificación para aquellos miembros " "configurados con ``None`` como valor. Estos serán simplemente objetos " "simulados ordinarios (MagicMocks en realidad):" @@ -3312,21 +3337,21 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:2717 msgid "" "If modifying your production classes to add defaults isn't to your liking " -"then there are more options. One of these is simply to use an instance as the " -"spec rather than the class. The other is to create a subclass of the " +"then there are more options. One of these is simply to use an instance as " +"the spec rather than the class. The other is to create a subclass of the " "production class and add the defaults to the subclass without affecting the " "production class. Both of these require you to use an alternative object as " "the spec. Thankfully :func:`patch` supports this - you can simply pass the " "alternative object as the *autospec* argument::" msgstr "" -"Si modificar tus clases en producción para agregar valores predeterminados no " -"es de tu agrado, dispones de otras opciones. Una de ellas es simplemente usar " -"una instancia como especificación en lugar de la clase. La otra es crear una " -"subclase de la clase en producción y agregar los valores predeterminados a la " -"subclase, sin afectar a la clase en producción. Ambas alternativas requieren " -"que uses un objeto alternativo como especificación. Afortunadamente :func:" -"`patch` admite esto, simplemente tienes que pasar el objeto alternativo " -"mediante el argumento *autospec*:" +"Si modificar tus clases en producción para agregar valores predeterminados " +"no es de tu agrado, dispones de otras opciones. Una de ellas es simplemente " +"usar una instancia como especificación en lugar de la clase. La otra es " +"crear una subclase de la clase en producción y agregar los valores " +"predeterminados a la subclase, sin afectar a la clase en producción. Ambas " +"alternativas requieren que uses un objeto alternativo como especificación. " +"Afortunadamente :func:`patch` admite esto, simplemente tienes que pasar el " +"objeto alternativo mediante el argumento *autospec*:" #: ../Doc/library/unittest.mock.rst:2738 msgid "" @@ -3345,9 +3370,9 @@ msgstr "Sellar objetos simulados" #: ../Doc/library/unittest.mock.rst:2752 msgid "" -"Seal will disable the automatic creation of mocks when accessing an attribute " -"of the mock being sealed or any of its attributes that are already mocks " -"recursively." +"Seal will disable the automatic creation of mocks when accessing an " +"attribute of the mock being sealed or any of its attributes that are already " +"mocks recursively." msgstr "" "Seal desactivará la creación automática de objetos simulados al acceder a un " "atributo del objeto simulado que está siendo sellado, o a cualquiera de sus " @@ -3355,10 +3380,10 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:2755 msgid "" -"If a mock instance with a name or a spec is assigned to an attribute it won't " -"be considered in the sealing chain. This allows one to prevent seal from " -"fixing part of the mock object. ::" +"If a mock instance with a name or a spec is assigned to an attribute it " +"won't be considered in the sealing chain. This allows one to prevent seal " +"from fixing part of the mock object. ::" msgstr "" -"Si una instancia simulada con un nombre o una especificación es asignada a un " -"atributo no será considerada en la cadena de sellado. Esto permite evitar que " -"seal fije partes del objeto simulado. ::" +"Si una instancia simulada con un nombre o una especificación es asignada a " +"un atributo no será considerada en la cadena de sellado. Esto permite evitar " +"que seal fije partes del objeto simulado. ::" From 2703de7d3fa9a5e7d2517a3961a6458072398691 Mon Sep 17 00:00:00 2001 From: fjsevilla Date: Mon, 19 Oct 2020 11:10:47 +0200 Subject: [PATCH 04/10] =?UTF-8?q?Aplicados=20cambios=20desde=20revisi?= =?UTF-8?q?=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/unittest.mock.po | 119 ++++++++++++++++++++------------------- 1 file changed, 60 insertions(+), 59 deletions(-) diff --git a/library/unittest.mock.po b/library/unittest.mock.po index bdb17f4d8a..f5a31a9356 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -145,11 +145,11 @@ msgid "" "decorators are applied). This means from the bottom up, so in the example " "above the mock for ``module.ClassName1`` is passed in first." msgstr "" -"Cuando anidas decoradores de parcheo, los objetos simulados se pasan a la " -"función decorada en el mismo orden en el que fueron aplicados (el orden " -"normal en el que se aplican los decoradores en *Python*). Esto significa de " -"abajo hacia arriba, por lo que en el ejemplo anterior se pasa primero el " -"objeto simulado para ``module.ClassName1``." +"Cuando anidas decoradores patch, los objetos simulados se pasan a la función " +"decorada en el mismo orden en el que fueron aplicados (el orden normal en el " +"que se aplican los decoradores en *Python*). Esto significa de abajo hacia " +"arriba, por lo que en el ejemplo anterior se pasa primero el objeto simulado " +"para ``module.ClassName1``." #: ../Doc/library/unittest.mock.rst:121 msgid "" @@ -166,8 +166,8 @@ msgid "" "As well as a decorator :func:`patch` can be used as a context manager in a " "with statement:" msgstr "" -"Además de como decorador, la función :func:`patch` se puede usar como gestor " -"de contexto en una declaración with:" +"Además de decorador, la función :func:`patch` se puede usar como gestor de " +"contexto en una declaración with:" #: ../Doc/library/unittest.mock.rst:135 msgid "" @@ -344,7 +344,7 @@ msgid "" "value of this function is used as the return value." msgstr "" "*side_effect*: Una función que se llamará cada vez que el objeto simulado " -"sea llamado. Consultar el atributo :attr:`~Mock.side_effect` para más " +"sea invocado. Consultar el atributo :attr:`~Mock.side_effect` para más " "información. Es útil para lanzar excepciones o para cambiar dinámicamente " "valores de retorno. La función se llama con los mismos argumentos que el " "objeto simulado, y a menos que retorne :data:`DEFAULT`, su valor de retorno " @@ -431,18 +431,18 @@ msgid "" "used to set attributes on the mock after it is created. See the :meth:" "`configure_mock` method for details." msgstr "" -"Los objetos simulados también pueden ser llamados con argumentos por palabra " -"clave arbitrarios. Estos serán utilizados para establecer atributos en el " -"objeto simulado una vez creado. Consultar el método :meth:`configure_mock` " -"para más detalles." +"Los objetos simulados también pueden ser invocados con argumentos por " +"palabra clave arbitrarios. Estos serán utilizados para establecer atributos " +"en el objeto simulado una vez creado. Consultar el método :meth:" +"`configure_mock` para más detalles." #: ../Doc/library/unittest.mock.rst:291 msgid "Assert that the mock was called at least once." -msgstr "Aserta si el objeto simulado se ha llamado al menos una vez." +msgstr "Aserta si el objeto simulado se ha invocado al menos una vez." #: ../Doc/library/unittest.mock.rst:302 msgid "Assert that the mock was called exactly once." -msgstr "Aserta si el objeto simulado se ha llamado exactamente una vez." +msgstr "Aserta si el objeto simulado se ha invocado exactamente una vez." #: ../Doc/library/unittest.mock.rst:320 msgid "" @@ -457,13 +457,13 @@ msgid "" "Assert that the mock was called exactly once and that that call was with the " "specified arguments." msgstr "" -"Aserta si el objeto simulado se ha llamado exactamente una vez y si esa " +"Aserta si el objeto simulado se ha invocado exactamente una vez y si esa " "llamada se realizó con los argumentos especificados." #: ../Doc/library/unittest.mock.rst:345 msgid "assert the mock has been called with the specified arguments." msgstr "" -"Aserta si el objeto simulado se ha llamado con los argumentos especificados." +"Aserta si el objeto simulado se ha invocado con los argumentos especificados." #: ../Doc/library/unittest.mock.rst:347 msgid "" @@ -472,7 +472,7 @@ msgid "" "the call is the most recent one, and in the case of :meth:" "`assert_called_once_with` it must also be the only call." msgstr "" -"La aserción pasa si el objeto simulado se ha llamado *en algún momento*, a " +"La aserción pasa si el objeto simulado se ha invocado *en algún momento*, a " "diferencia de :meth:`assert_called_with` y :meth:`assert_called_once_with`, " "con los que sólo pasa la aserción si la llamada es la más reciente, y en el " "caso de :meth:`assert_called_once_with` también debe ser la única llamada " @@ -483,7 +483,7 @@ msgid "" "assert the mock has been called with the specified calls. The :attr:" "`mock_calls` list is checked for the calls." msgstr "" -"Aserta si el objeto simulado se ha llamado con las llamadas especificadas. " +"Aserta si el objeto simulado se ha invocado con las llamadas especificadas. " "La lista :attr:`mock_calls` se compara con la lista de llamadas." #: ../Doc/library/unittest.mock.rst:363 @@ -505,7 +505,7 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:382 msgid "Assert the mock was never called." -msgstr "Aserta si el objeto simulado nunca fue llamado." +msgstr "Aserta si el objeto simulado nunca fue invocado." #: ../Doc/library/unittest.mock.rst:397 msgid "The reset_mock method resets all the call attributes on a mock object:" @@ -635,12 +635,13 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:496 msgid "A boolean representing whether or not the mock object has been called:" -msgstr "Un booleano que representa si el objeto simulado ha sido llamado o no:" +msgstr "" +"Un booleano que representa si el objeto simulado ha sido invocado o no:" #: ../Doc/library/unittest.mock.rst:507 msgid "An integer telling you how many times the mock object has been called:" msgstr "" -"Un entero que le indica cuántas veces el objeto simulado ha sido llamado:" +"Un entero que le indica cuántas veces el objeto simulado ha sido invocado:" #: ../Doc/library/unittest.mock.rst:519 msgid "Set this to configure the value returned by calling the mock:" @@ -681,8 +682,8 @@ msgstr "" "Si pasas una función, será llamada con los mismos argumentos que el objeto " "simulado y, a menos que la función retorne el singleton :data:`DEFAULT`, la " "llamada al objeto simulado retornará lo mismo que retorna la función. En " -"cambio, si la función retorna :data:`DEFAULT` el objeto simulado retornará " -"su valor normal (el del atributo :attr:`return_value`)." +"cambio, si la función retorna :data:`DEFAULT`, entonces el objeto simulado " +"retornará su valor normal (el del atributo :attr:`return_value`)." #: ../Doc/library/unittest.mock.rst:555 msgid "" @@ -719,7 +720,7 @@ msgid "" "adds one to the value the mock is called with and returns it:" msgstr "" ":attr:`side_effect` se puede establecer en el constructor. Aquí hay un " -"ejemplo que suma uno al valor del objeto simulado llamado y lo retorna:" +"ejemplo que suma uno al valor del objeto simulado invocado y lo retorna:" #: ../Doc/library/unittest.mock.rst:597 msgid "Setting :attr:`side_effect` to ``None`` clears it:" @@ -734,7 +735,7 @@ msgid "" "second member, which can also be accessed through the ``kwargs`` property, " "is any keyword arguments (or an empty dictionary)." msgstr "" -"Este atributo es ``None`` (si el objeto simulado no ha sido llamado) o los " +"Este atributo es ``None`` (si el objeto simulado no ha sido invocado) o los " "argumentos con los que se llamó por última vez. En este último caso, será " "una tupla con dos elementos: el primer miembro, que también es accesible a " "través de la propiedad ``args``, son los argumentos posicionales con los que " @@ -767,7 +768,7 @@ msgid "" msgstr "" "Este argumento es una lista de todas las llamadas consecutivas realizadas al " "objeto simulado (por lo que la longitud de la lista es el número de veces " -"que se ha llamado). Previamente a que se hayan realizado llamadas es una " +"que se ha invocado). Previamente a que se hayan realizado llamadas es una " "lista vacía. El objeto :data:`call` se puede utilizar para construir " "convenientemente las listas de llamadas a comparar con :attr:" "`call_args_list`." @@ -954,7 +955,7 @@ msgid "" "Fetching a :class:`PropertyMock` instance from an object calls the mock, " "with no args. Setting it calls the mock with the value being set. ::" msgstr "" -"La obtención de una instancia desde un objeto :class:`PropertyMock` ocasiona " +"La obtención de una intancia :class:`PropertyMock` desde un objeto ocasiona " "una llamada al objeto simulado, sin argumentos. Establecer su valor también " "llama al objeto simulado, con el valor a establecer como argumento." @@ -976,7 +977,7 @@ msgid "" msgstr "" "Una versión asíncrona de :class:`Mock`. El objeto :class:`AsyncMock` se " "comportará de tal modo que el objeto es reconocido como una función " -"asíncrona y el resultado de su llamada es un objeto 'esperable' (awaitable)." +"asíncrona y el resultado de su llamada es un objeto aguardable (awaitable)." #: ../Doc/library/unittest.mock.rst:867 msgid "" @@ -985,7 +986,7 @@ msgid "" msgstr "" "El resultado de ``mock()`` es una función asíncrona que proporcionará el " "resultado de ``side_effect`` o de ``return_value`` después de haber sido " -"'esperada':" +"aguardada:" #: ../Doc/library/unittest.mock.rst:870 msgid "" @@ -1054,31 +1055,31 @@ msgid "" "Assert that the mock was awaited at least once. Note that this is separate " "from the object having been called, the ``await`` keyword must be used:" msgstr "" -"Aserta si el objeto simulado fue 'esperado' al menos una vez. Ten en cuenta " -"que, independientemente del objeto que ha sido llamado, la palabra clave " +"Aserta si el objeto simulado fue aguardado al menos una vez. Ten en cuenta " +"que, independientemente del objeto que ha sido invocado, la palabra clave " "``await`` debe ser utilizada:" #: ../Doc/library/unittest.mock.rst:941 msgid "Assert that the mock was awaited exactly once." -msgstr "Aserta si que el objeto simulado fue 'esperado' exactamente una vez." +msgstr "Aserta si que el objeto simulado fue aguardado exactamente una vez." #: ../Doc/library/unittest.mock.rst:957 msgid "Assert that the last await was with the specified arguments." msgstr "" -"Aserta si la última 'espera' (await) fue con los argumentos especificados." +"Aserta si el último aguardo (await) fue con los argumentos especificados." #: ../Doc/library/unittest.mock.rst:974 msgid "" "Assert that the mock was awaited exactly once and with the specified " "arguments." msgstr "" -"Aserta si que el objeto simulado se ha 'esperado' exactamente una vez y con " +"Aserta si que el objeto simulado se ha aguardado exactamente una vez y con " "los argumentos especificados." #: ../Doc/library/unittest.mock.rst:991 msgid "Assert the mock has ever been awaited with the specified arguments." msgstr "" -"Aserta si el objeto simulado nunca se ha 'esperado' con los argumentos " +"Aserta si el objeto simulado nunca se ha aguardado con los argumentos " "especificados." #: ../Doc/library/unittest.mock.rst:1007 @@ -1086,8 +1087,8 @@ msgid "" "Assert the mock has been awaited with the specified calls. The :attr:" "`await_args_list` list is checked for the awaits." msgstr "" -"Aserta si el objeto simulado ha sido 'esperado' con las llamadas " -"especificadas. Para comprobar las 'esperas' (awaits) se utiliza la lista :" +"Aserta si el objeto simulado ha sido aguardado con las llamadas " +"especificadas. Para comprobar los aguardos (awaits) se utiliza la lista :" "attr:`await_args_list`." #: ../Doc/library/unittest.mock.rst:1010 @@ -1095,21 +1096,21 @@ msgid "" "If *any_order* is false then the awaits must be sequential. There can be " "extra calls before or after the specified awaits." msgstr "" -"Si *any_order* es falso, las 'esperas' (awaits) deben ser secuenciales. No " -"puede haber llamadas adicionales antes o después de las 'esperas' " -"especificadas." +"Si *any_order* es falso, los aguardos (awaits) deben ser secuenciales. No " +"puede haber llamadas adicionales antes o después de los aguardos " +"especificados." #: ../Doc/library/unittest.mock.rst:1014 msgid "" "If *any_order* is true then the awaits can be in any order, but they must " "all appear in :attr:`await_args_list`." msgstr "" -"Si *any_order* es verdadero, entonces las 'esperas' (awaits) pueden estar en " -"cualquier orden, pero deben aparecer todas en :attr:`await_args_list`." +"Si *any_order* es verdadero, entonces los aguardos (awaits) pueden estar en " +"cualquier orden, pero deben aparecer todos en :attr:`await_args_list`." #: ../Doc/library/unittest.mock.rst:1034 msgid "Assert that the mock was never awaited." -msgstr "Aserta si el objeto simulado nunca ha sido 'esperado'." +msgstr "Aserta si el objeto simulado nunca ha sido aguardado." #: ../Doc/library/unittest.mock.rst:1041 msgid "" @@ -1123,7 +1124,7 @@ msgstr "" msgid "" "An integer keeping track of how many times the mock object has been awaited." msgstr "" -"Un registro entero de cuántas veces se ha 'esperado' el objeto simulado." +"Un registro entero de cuántas veces se ha aguardado el objeto simulado." #: ../Doc/library/unittest.mock.rst:1061 msgid "" @@ -1131,8 +1132,8 @@ msgid "" "that the mock was last awaited with. Functions the same as :attr:`Mock." "call_args`." msgstr "" -"Este atributo es ``None`` (si el objeto simulado no se ha 'esperado') o los " -"argumentos con los que fue 'esperado' la última vez. Su funcionamiento es " +"Este atributo es ``None`` (si el objeto simulado no se ha aguardado) o los " +"argumentos con los que fue aguardado la última vez. Su funcionamiento es " "idéntico al de :attr:`Mock.call_args`." #: ../Doc/library/unittest.mock.rst:1079 @@ -1141,10 +1142,10 @@ msgid "" "length of the list is the number of times it has been awaited). Before any " "awaits have been made it is an empty list." msgstr "" -"Es una lista de todas las 'esperas' (awaits) realizadas en el objeto " -"simulado de forma secuencial (por lo que la longitud de la lista es el " -"número de veces que se ha 'esperado' el objeto). Si no se han realizado " -"'esperas' previas es una lista vacía." +"Es una lista de todas los aguardos (awaits) realizados en el objeto simulado " +"de forma secuencial (por lo que la longitud de la lista es el número de " +"veces que se ha aguardado el objeto). Si no se han realizado aguardos " +"previos, es una lista vacía." #: ../Doc/library/unittest.mock.rst:1098 msgid "Calling" @@ -1179,7 +1180,7 @@ msgid "" "has been recorded, so if :attr:`side_effect` raises an exception the call is " "still recorded." msgstr "" -"Si :attr:`~Mock.side_effect` se establece, será llamado después de que la " +"Si :attr:`~Mock.side_effect` se establece, será invocado después de que la " "llamada haya sido registrada, por lo que la llamada se registra aunque :attr:" "`side_effect` genere una excepción." @@ -1189,7 +1190,7 @@ msgid "" "attr:`~Mock.side_effect` an exception class or instance:" msgstr "" "La forma más sencilla de hacer un objeto simulado lance de una excepción " -"cuando sea llamado es establecer su atributo :attr:`~Mock.side_effect` como " +"cuando sea invocado es establecer su atributo :attr:`~Mock.side_effect` como " "una clase o instancia de excepción:" #: ../Doc/library/unittest.mock.rst:1131 @@ -1202,7 +1203,7 @@ msgstr "" "Si :attr:`side_effect` es una función, la llamada al objeto simulado " "retornará lo que sea que esta función retorne. La función establecida en :" "attr:`side_effect` se llama con los mismos argumentos con los que el objeto " -"simulado ha sido llamado. Esto te permite variar el valor de retorno de la " +"simulado ha sido invocado. Esto te permite variar el valor de retorno de la " "llamada dinámicamente, en función de la entrada:" #: ../Doc/library/unittest.mock.rst:1147 @@ -1458,7 +1459,7 @@ msgid "" "`AsyncMock` is used for async functions and :class:`MagicMock` for the rest." msgstr "" "*new_callable* te permite especificar una clase diferente, o un objeto " -"invocable, que será llamada para crear el objeto *new*. Por defecto se " +"invocable, que será invocada para crear el objeto *new*. Por defecto se " "utiliza :class:`AsyncMock` para las funciones asíncronas y :class:" "`MagicMock` para el resto." @@ -1697,8 +1698,8 @@ msgid "" "patch the named member (*attribute*) on an object (*target*) with a mock " "object." msgstr "" -"parchea el miembro llamado *attribute* de un objeto (*target*) con un objeto " -"simulado." +"parchea el miembro *attribute* invocado de un objeto (*target*) con un " +"objeto simulado." #: ../Doc/library/unittest.mock.rst:1539 msgid "" @@ -1805,7 +1806,7 @@ msgid "" ":func:`patch.dict` can also be called with arbitrary keyword arguments to " "set values in the dictionary." msgstr "" -"La función :func:`patch.dict` también puede ser llamada con argumentos por " +"La función :func:`patch.dict` también puede ser invocada con argumentos por " "palabra clave arbitrarios para establecer los valores en el diccionario." #: ../Doc/library/unittest.mock.rst:1593 @@ -2808,7 +2809,7 @@ msgid "" "ensure that they are called with the correct signature." msgstr "" "Los argumentos de las funciones o métodos simulados se validarán para " -"asegurarse de que son llamados con la firma correcta." +"asegurarse de que son invocados con la firma correcta." #: ../Doc/library/unittest.mock.rst:2322 msgid "" @@ -3036,7 +3037,7 @@ msgid "" msgstr "" "El problema es que, incluso si simulas la llamada a :func:`open`, es el " "*objeto retornado* el que se utiliza como gestor de contexto (lo que " -"conlleva que sus métodos :meth:`__enter__` y :meth:`__exit__` son llamados)." +"conlleva que sus métodos :meth:`__enter__` y :meth:`__exit__` son invocados)." #: ../Doc/library/unittest.mock.rst:2482 msgid "" From 934ddb2a3b1402d27dff2adb31f7b409e546de5a Mon Sep 17 00:00:00 2001 From: fjsevilla Date: Mon, 19 Oct 2020 11:28:05 +0200 Subject: [PATCH 05/10] =?UTF-8?q?Correcci=C3=B3n=20de=20typo=20marcado=20p?= =?UTF-8?q?or=20pospell?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/unittest.mock.po | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/library/unittest.mock.po b/library/unittest.mock.po index f5a31a9356..36c0cedbdb 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -145,7 +145,7 @@ msgid "" "decorators are applied). This means from the bottom up, so in the example " "above the mock for ``module.ClassName1`` is passed in first." msgstr "" -"Cuando anidas decoradores patch, los objetos simulados se pasan a la función " +"Cuando anidas decoradores patch, los objetos simulados se pasan a la función "po "decorada en el mismo orden en el que fueron aplicados (el orden normal en el " "que se aplican los decoradores en *Python*). Esto significa de abajo hacia " "arriba, por lo que en el ejemplo anterior se pasa primero el objeto simulado " @@ -368,7 +368,7 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:259 msgid "A *side_effect* can be cleared by setting it to ``None``." -msgstr "Un *side_effect* se puede desactivar estableciéndolo en ``None``." +msgstr "Un *side_effect* se puede desactivar estableciéndolo en ``None``."po #: ../Doc/library/unittest.mock.rst:261 msgid "" @@ -396,7 +396,7 @@ msgid "" "*wraps*: Item for the mock object to wrap. If *wraps* is not ``None`` then " "calling the Mock will pass the call through to the wrapped object (returning " "the real result). Attribute access on the mock will return a Mock object " -"that wraps the corresponding attribute of the wrapped object (so attempting " +"that wraps the corresponding attribute of the wrapped object (so attempting "po "to access an attribute that doesn't exist will raise an :exc:" "`AttributeError`)." msgstr "" @@ -443,12 +443,12 @@ msgstr "Aserta si el objeto simulado se ha invocado al menos una vez." #: ../Doc/library/unittest.mock.rst:302 msgid "Assert that the mock was called exactly once." msgstr "Aserta si el objeto simulado se ha invocado exactamente una vez." - +po #: ../Doc/library/unittest.mock.rst:320 msgid "" "This method is a convenient way of asserting that the last call has been " "made in a particular way:" -msgstr "" +msgstr ""po "Este método es una manera apropiada de asertar si la última llamada se ha " "realizado de una manera particular:" @@ -955,7 +955,7 @@ msgid "" "Fetching a :class:`PropertyMock` instance from an object calls the mock, " "with no args. Setting it calls the mock with the value being set. ::" msgstr "" -"La obtención de una intancia :class:`PropertyMock` desde un objeto ocasiona " +"La obtención de una instancia :class:`PropertyMock` desde un objeto ocasiona " "una llamada al objeto simulado, sin argumentos. Establecer su valor también " "llama al objeto simulado, con el valor a establecer como argumento." From f660e62f1a4d857ffae1acad74b7f02743a3a58a Mon Sep 17 00:00:00 2001 From: fjsevilla Date: Mon, 19 Oct 2020 12:14:48 +0200 Subject: [PATCH 06/10] Update unittest.mock.po --- library/unittest.mock.po | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/library/unittest.mock.po b/library/unittest.mock.po index 36c0cedbdb..772c4fd7ed 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -145,7 +145,7 @@ msgid "" "decorators are applied). This means from the bottom up, so in the example " "above the mock for ``module.ClassName1`` is passed in first." msgstr "" -"Cuando anidas decoradores patch, los objetos simulados se pasan a la función "po +"Cuando anidas decoradores patch, los objetos simulados se pasan a la función " "decorada en el mismo orden en el que fueron aplicados (el orden normal en el " "que se aplican los decoradores en *Python*). Esto significa de abajo hacia " "arriba, por lo que en el ejemplo anterior se pasa primero el objeto simulado " @@ -368,7 +368,7 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:259 msgid "A *side_effect* can be cleared by setting it to ``None``." -msgstr "Un *side_effect* se puede desactivar estableciéndolo en ``None``."po +msgstr "Un *side_effect* se puede desactivar estableciéndolo en ``None``." #: ../Doc/library/unittest.mock.rst:261 msgid "" @@ -396,7 +396,7 @@ msgid "" "*wraps*: Item for the mock object to wrap. If *wraps* is not ``None`` then " "calling the Mock will pass the call through to the wrapped object (returning " "the real result). Attribute access on the mock will return a Mock object " -"that wraps the corresponding attribute of the wrapped object (so attempting "po +"that wraps the corresponding attribute of the wrapped object (so attempting " "to access an attribute that doesn't exist will raise an :exc:" "`AttributeError`)." msgstr "" @@ -443,12 +443,12 @@ msgstr "Aserta si el objeto simulado se ha invocado al menos una vez." #: ../Doc/library/unittest.mock.rst:302 msgid "Assert that the mock was called exactly once." msgstr "Aserta si el objeto simulado se ha invocado exactamente una vez." -po + #: ../Doc/library/unittest.mock.rst:320 msgid "" "This method is a convenient way of asserting that the last call has been " "made in a particular way:" -msgstr ""po +msgstr "" "Este método es una manera apropiada de asertar si la última llamada se ha " "realizado de una manera particular:" From 870c34b10811e90b92ef0474d9d5a58a01b837a7 Mon Sep 17 00:00:00 2001 From: fjsevilla Date: Sun, 25 Oct 2020 13:04:48 +0100 Subject: [PATCH 07/10] =?UTF-8?q?Aplicadas=20sugerencias=20de=20revisi?= =?UTF-8?q?=C3=B3n.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/unittest.mock.po | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/library/unittest.mock.po b/library/unittest.mock.po index 772c4fd7ed..fcbd60edfb 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -1061,7 +1061,7 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:941 msgid "Assert that the mock was awaited exactly once." -msgstr "Aserta si que el objeto simulado fue aguardado exactamente una vez." +msgstr "Aserta si el objeto simulado fue aguardado exactamente una vez." #: ../Doc/library/unittest.mock.rst:957 msgid "Assert that the last await was with the specified arguments." @@ -1182,14 +1182,14 @@ msgid "" msgstr "" "Si :attr:`~Mock.side_effect` se establece, será invocado después de que la " "llamada haya sido registrada, por lo que la llamada se registra aunque :attr:" -"`side_effect` genere una excepción." +"`side_effect` lance una excepción." #: ../Doc/library/unittest.mock.rst:1113 msgid "" "The simplest way to make a mock raise an exception when called is to make :" "attr:`~Mock.side_effect` an exception class or instance:" msgstr "" -"La forma más sencilla de hacer un objeto simulado lance de una excepción " +"La forma más sencilla de hacer que un objeto simulado lance de una excepción " "cuando sea invocado es establecer su atributo :attr:`~Mock.side_effect` como " "una clase o instancia de excepción:" @@ -1372,7 +1372,7 @@ msgid "" "you, even if exceptions are raised. All of these functions can also be used " "in with statements or as class decorators." msgstr "" -"Los decoradores path se utilizan para parchear los objetos sólo dentro del " +"Los decoradores patch se utilizan para parchear los objetos sólo dentro del " "ámbito de la función que decoran. Se encargan automáticamente de desparchear " "una vez terminada la prueba, incluso si se lanzan excepciones. Todas estas " "funciones también se pueden utilizar con declaraciones o como decoradores de " @@ -1441,7 +1441,7 @@ msgid "" "The *spec* and *spec_set* keyword arguments are passed to the :class:" "`MagicMock` if patch is creating one for you." msgstr "" -"Los argumentos *spec* y *spec_set* se pasan a :class:`MagicMock` si path " +"Los argumentos *spec* y *spec_set* se pasan a :class:`MagicMock` si patch " "está creando automáticamente uno para ti." #: ../Doc/library/unittest.mock.rst:1357 @@ -1450,7 +1450,7 @@ msgid "" "patch to pass in the object being mocked as the spec/spec_set object." msgstr "" "Además, puedes pasar ``spec=True`` o ``spec_set=True``, lo que causa que " -"path pase el objeto que está siendo simulado como el objeto spec/spec_set." +"patch pase el objeto que está siendo simulado como el objeto spec/spec_set." #: ../Doc/library/unittest.mock.rst:1360 msgid "" @@ -1531,7 +1531,7 @@ msgid "" "tests. You can specify an alternative prefix by setting ``patch." "TEST_PREFIX``." msgstr "" -"Path puede ser usado como un decorador de la clase :class:`TestCase`. " +"Patch puede ser usado como un decorador de la clase :class:`TestCase`. " "Funciona decorando cada uno de los métodos de prueba presentes en la clase. " "Esto reduce el código repetitivo cuando tus métodos de prueba comparten un " "conjunto de parcheo común. :func:`patch` encuentra las pruebas mediante la " @@ -1567,7 +1567,7 @@ msgid "" "available for alternate use-cases." msgstr "" "``patch.dict(...)``, ``patch.multiple(...)`` y ``patch.object(...)`` están " -"disponibles para casos alternativos de uso." +"disponibles para casos de uso alternativos." #: ../Doc/library/unittest.mock.rst:1409 msgid "" @@ -1698,8 +1698,8 @@ msgid "" "patch the named member (*attribute*) on an object (*target*) with a mock " "object." msgstr "" -"parchea el miembro *attribute* invocado de un objeto (*target*) con un " -"objeto simulado." +"parchea el miembro *attribute* invocado de un objeto *target* con un objeto " +"simulado." #: ../Doc/library/unittest.mock.rst:1539 msgid "" @@ -1980,10 +1980,10 @@ msgid "" "then call :meth:`start` to put the patch in place and :meth:`stop` to undo " "it." msgstr "" -"Para utilizarlos estos métodos, llama a :func:`patch`, :func:`patch.object` " -"o :func:`patch.dict` como haces normalmente y mantén una referencia al " -"objeto ``patcher`` retornado. A continuación, puedes llamar al método :meth:" -"`start` para aplicar el parche y a :meth:`stop` para deshacerlo." +"Para utilizar estos métodos, llama a :func:`patch`, :func:`patch.object` o :" +"func:`patch.dict` como haces normalmente y mantén una referencia al objeto " +"``patcher`` retornado. A continuación, puedes llamar al método :meth:`start` " +"para aplicar el parche y a :meth:`stop` para deshacerlo." #: ../Doc/library/unittest.mock.rst:1755 msgid "" @@ -2088,7 +2088,7 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:1871 msgid "You can stack up multiple patch decorators using this pattern:" -msgstr "Puede apilar múltiples decoradores path usando el siguiente patrón:" +msgstr "Puede apilar múltiples decoradores patch usando el siguiente patrón:" #: ../Doc/library/unittest.mock.rst:1887 msgid "" @@ -2193,8 +2193,9 @@ msgstr "" "restauran posteriormente: métodos de clase, métodos estáticos y propiedades. " "Los descriptores deben ser parcheados en la *clase* y no en una instancia. " "También funcionan con *algunos* objetos que actúan como proxy en el acceso a " -"atributos, como `los objetos de configuración de django `_." +"atributos, como el objeto de configuraciones de django (django settings " +"object `_)." #: ../Doc/library/unittest.mock.rst:1947 msgid "MagicMock and magic method support" @@ -2354,14 +2355,14 @@ msgstr "Métodos de iteración asíncronos: ``__aiter__`` y ``__anext__``" #: ../Doc/library/unittest.mock.rst:2030 msgid "Added support for :func:`os.PathLike.__fspath__`." -msgstr "Soporte para :func:`os.PathLike.__fspath__` añadido." +msgstr "Se añadió soporte para :func:`os.PathLike.__fspath__`." #: ../Doc/library/unittest.mock.rst:2033 msgid "" "Added support for ``__aenter__``, ``__aexit__``, ``__aiter__`` and " "``__anext__``." msgstr "" -"Añadido soporte para ``__aenter__``, ``__aexit__``, ``__aiter__`` y " +"Se añadió soporte para ``__aenter__``, ``__aexit__``, ``__aiter__`` y " "``__anext__``." #: ../Doc/library/unittest.mock.rst:2037 @@ -3388,3 +3389,4 @@ msgstr "" "Si una instancia simulada con un nombre o una especificación es asignada a " "un atributo no será considerada en la cadena de sellado. Esto permite evitar " "que seal fije partes del objeto simulado. ::" + From c611f92c0c28ba1b8d6a0eb95a1777d6668d2146 Mon Sep 17 00:00:00 2001 From: fjsevilla Date: Sun, 25 Oct 2020 13:32:02 +0100 Subject: [PATCH 08/10] =?UTF-8?q?Agregados=20t=C3=A9rminos=20al=20dicciona?= =?UTF-8?q?rio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dictionaries/library_unittest.mock.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dictionaries/library_unittest.mock.txt b/dictionaries/library_unittest.mock.txt index d8d1bf5f3a..04768a2701 100644 --- a/dictionaries/library_unittest.mock.txt +++ b/dictionaries/library_unittest.mock.txt @@ -7,6 +7,7 @@ Autoespecificación backport configurarlos desparchear +django introspeccionará MagicMock mock @@ -18,9 +19,9 @@ preconfigurados refactorizas seal Seal +settings síncronas sizeof start stop stubs - From 30f6fd690ef400b6f51867c062e0b5f4ddbdee4f Mon Sep 17 00:00:00 2001 From: fjsevilla Date: Sun, 25 Oct 2020 13:55:58 +0100 Subject: [PATCH 09/10] Corregido error en referencia a enlace externo --- library/unittest.mock.po | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/library/unittest.mock.po b/library/unittest.mock.po index fcbd60edfb..2b08e606f6 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -2193,7 +2193,7 @@ msgstr "" "restauran posteriormente: métodos de clase, métodos estáticos y propiedades. " "Los descriptores deben ser parcheados en la *clase* y no en una instancia. " "También funcionan con *algunos* objetos que actúan como proxy en el acceso a " -"atributos, como el objeto de configuraciones de django (django settings " +"atributos, como el objeto de configuraciones de django (`django settings " "object `_)." @@ -3389,4 +3389,3 @@ msgstr "" "Si una instancia simulada con un nombre o una especificación es asignada a " "un atributo no será considerada en la cadena de sellado. Esto permite evitar " "que seal fije partes del objeto simulado. ::" - From 057d7020d5c9530b67bb3fe063731723953ad9f1 Mon Sep 17 00:00:00 2001 From: fjsevilla Date: Mon, 26 Oct 2020 15:04:00 +0100 Subject: [PATCH 10/10] =?UTF-8?q?Aplicadas=20sugerencias=20de=20revisi?= =?UTF-8?q?=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/unittest.mock.po | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/library/unittest.mock.po b/library/unittest.mock.po index 2b08e606f6..522abced7a 100644 --- a/library/unittest.mock.po +++ b/library/unittest.mock.po @@ -515,7 +515,8 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:407 msgid "Added two keyword only argument to the reset_mock function." -msgstr "Añadidos dos argumentos por palabra clave a la función *reset_mock*." +msgstr "" +"Se añadieron dos argumentos por palabra clave a la función *reset_mock*." #: ../Doc/library/unittest.mock.rst:410 msgid "" @@ -936,7 +937,7 @@ msgstr "" #: ../Doc/library/unittest.mock.rst:812 msgid "Added signature introspection on specced and autospecced mock objects." msgstr "" -"Añadida introspección de firma en objetos simulados especificados y " +"Se añadió introspección de firma en objetos simulados especificados y " "autoespecificados." #: ../Doc/library/unittest.mock.rst:818 @@ -2817,8 +2818,8 @@ msgid "" "If *spec_set* is ``True`` then attempting to set attributes that don't exist " "on the spec object will raise an :exc:`AttributeError`." msgstr "" -"Si es *spec_set* es ``True``, tratar de establecer atributos que no existen " -"en el objeto especificado lanzará una excepción :exc:`AttributeError`." +"Si *spec_set* es ``True``, tratar de establecer atributos que no existen en " +"el objeto especificado lanzará una excepción :exc:`AttributeError`." #: ../Doc/library/unittest.mock.rst:2325 msgid "" @@ -2827,9 +2828,9 @@ msgid "" "an instance object by passing ``instance=True``. The returned mock will only " "be callable if instances of the mock are callable." msgstr "" -"Si se utilizada una clase como especificación, el valor de retorno del " -"objeto simulado (la instancia de la clase) tendrá la misma especificación. " -"Se puede utilizar una clase como especificación de una instancia pasando " +"Si se utiliza una clase como especificación, el valor de retorno del objeto " +"simulado (la instancia de la clase) tendrá la misma especificación. Se puede " +"utilizar una clase como especificación de una instancia pasando " "``instance=True``. El objeto simulado retornado sólo será invocable si las " "instancias del objeto simulado son también invocables." @@ -2961,9 +2962,10 @@ msgid "" "A helper function to create a mock to replace the use of :func:`open`. It " "works for :func:`open` called directly or used as a context manager." msgstr "" -"Una función auxiliar para un objeto simulado con la finalidad de reemplazar " -"el uso de :func:`open`. Funciona tanto para la llamada directa a :func:" -"`open` como utilizado como gestor de contexto." +"Una función auxiliar que permite crear un objeto simulado con la finalidad " +"de reemplazar el uso de :func:`open`. Funciona para simular llamadas " +"directas a :func:`open` y para aquellos casos en los que es utilizada como " +"gestor de contexto." #: ../Doc/library/unittest.mock.rst:2446 msgid "" @@ -3005,7 +3007,7 @@ msgid "" "The mock of :meth:`~io.IOBase.read` changed to consume *read_data* rather " "than returning it on each call." msgstr "" -"Añadido soporte para :meth:`~io.IOBase.readline` y :meth:`~io.IOBase." +"Se añadió soporte para :meth:`~io.IOBase.readline` y :meth:`~io.IOBase." "readlines`. El objeto simulado de :meth:`~io.IOBase.read` ahora consume " "datos de *read_data*, en lugar de retornarlo en cada llamada." @@ -3018,7 +3020,7 @@ msgid "" "Added :meth:`__iter__` to implementation so that iteration (such as in for " "loops) correctly consumes *read_data*." msgstr "" -"Añadido el método :meth:`__iter__` a la implementación, de manera que la " +"Se añadió el método :meth:`__iter__` a la implementación, de manera que la " "iteración (como ocurre en los bucles) consume apropiadamente *read_data*." #: ../Doc/library/unittest.mock.rst:2472 @@ -3253,7 +3255,7 @@ msgid "" "objects so that introspection is safe [#]_." msgstr "" "Sin embargo, este no es el comportamiento predeterminado, ya que no está " -"exento de advertencias y restricciones. Con el fin de conocer que atributos " +"exento de advertencias y restricciones. Con el fin de conocer qué atributos " "están disponibles en el objeto especificado, autospec tiene que hacer uso de " "introspección sobre la especificación (acceder a los atributos). A medida " "que recorres los atributos en el objeto simulado, se produce paralelamente y "