Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 88
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 215
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 216
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 217
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 218
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 219
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 220
ó
Š÷hc @ s` d Z d Z d d l Z d d l Z d d l Z d d l Z y d d l Z Wn e k
rk d d l Z n Xd d l Z d d l
Z
e j d ƒ Z e j
ƒ j Z e ƒ Z e ƒ Z d „ Z d „ Z d „ Z d „ Z d e f d
„ ƒ YZ d „ Z d „ Z d
„ Z d „ Z d „ Z d e f d „ ƒ YZ d „ Z d e j f d „ ƒ YZ! d „ Z" d S( s( Adds support for parameterized tests to Python's unittest TestCase class.
A parameterized test is a method in a test case that is invoked with different
argument tuples.
A simple example:
class AdditionExample(parameterized.ParameterizedTestCase):
@parameterized.Parameters(
(1, 2, 3),
(4, 5, 9),
(1, 1, 3))
def testAddition(self, op1, op2, result):
self.assertEqual(result, op1 + op2)
Each invocation is a separate test case and properly isolated just
like a normal test method, with its own setUp/tearDown cycle. In the
example above, there are three separate testcases, one of which will
fail due to an assertion error (1 + 1 != 3).
Parameters for invididual test cases can be tuples (with positional parameters)
or dictionaries (with named parameters):
class AdditionExample(parameterized.ParameterizedTestCase):
@parameterized.Parameters(
{'op1': 1, 'op2': 2, 'result': 3},
{'op1': 4, 'op2': 5, 'result': 9},
)
def testAddition(self, op1, op2, result):
self.assertEqual(result, op1 + op2)
If a parameterized test fails, the error message will show the
original test name (which is modified internally) and the arguments
for the specific invocation, which are part of the string returned by
the shortDescription() method on test cases.
The id method of the test, used internally by the unittest framework,
is also modified to show the arguments. To make sure that test names
stay the same across several invocations, object representations like
>>> class Foo(object):
... pass
>>> repr(Foo())
'<__main__.Foo object at 0x23d8610>'
are turned into '<__main__.Foo>'. For even more descriptive names,
especially in test logs, you can use the NamedParameters decorator. In
this case, only tuples are supported, and the first parameters has to
be a string (or an object that returns an apt name when converted via
str()):
class NamedExample(parameterized.ParameterizedTestCase):
@parameterized.NamedParameters(
('Normal', 'aa', 'aaa', True),
('EmptyPrefix', '', 'abc', True),
('BothEmpty', '', '', True))
def testStartsWith(self, prefix, string, result):
self.assertEqual(result, strings.startswith(prefix))
Named tests also have the benefit that they can be run individually
from the command line:
$ testmodule.py NamedExample.testStartsWithNormal
.
--------------------------------------------------------------------
Ran 1 test in 0.000s
OK
Parameterized Classes
=====================
If invocation arguments are shared across test methods in a single
ParameterizedTestCase class, instead of decorating all test methods
individually, the class itself can be decorated:
@parameterized.Parameters(
(1, 2, 3)
(4, 5, 9))
class ArithmeticTest(parameterized.ParameterizedTestCase):
def testAdd(self, arg1, arg2, result):
self.assertEqual(arg1 + arg2, result)
def testSubtract(self, arg2, arg2, result):
self.assertEqual(result - arg1, arg2)
Inputs from Iterables
=====================
If parameters should be shared across several test cases, or are dynamically
created from other sources, a single non-tuple iterable can be passed into
the decorator. This iterable will be used to obtain the test cases:
class AdditionExample(parameterized.ParameterizedTestCase):
@parameterized.Parameters(
c.op1, c.op2, c.result for c in testcases
)
def testAddition(self, op1, op2, result):
self.assertEqual(result, op1 + op2)
Single-Argument Test Methods
============================
If a test method takes only one argument, the single argument does not need to
be wrapped into a tuple:
class NegativeNumberExample(parameterized.ParameterizedTestCase):
@parameterized.Parameters(
-1, -3, -4, -5
)
def testIsNegative(self, arg):
self.assertTrue(IsNegative(arg))
s! tmarek@google.com (Torsten Marek)iÿÿÿÿNs0 \<([a-zA-Z0-9_\-\.]+) object at 0x[a-fA-F0-9]+\>c C s t j d t | ƒ ƒ S( Ns <\1>( t ADDR_REt subt repr( t obj( ( sK /usr/lib/python2.7/site-packages/google/protobuf/internal/_parameterized.pyt
_CleanRepr¥ s c C s d | j | j f S( Ns %s.%s( t
__module__t __name__( t cls( ( sK /usr/lib/python2.7/site-packages/google/protobuf/internal/_parameterized.pyt _StrClass« s c C s# t | t j ƒ o" t | t j ƒ S( N( t
isinstancet collectionst Iterablet sixt string_types( R ( ( sK /usr/lib/python2.7/site-packages/google/protobuf/internal/_parameterized.pyt _NonStringIterable¯ s c C sb t | t j ƒ r/ d j d „ | j ƒ Dƒ ƒ St | ƒ rQ d j t t | ƒ ƒ St | f ƒ Sd S( Ns , c s s+ | ]! \ } } d | t | ƒ f Vq d S( s %s=%sN( R ( t .0t argnamet value( ( sK /usr/lib/python2.7/site-packages/google/protobuf/internal/_parameterized.pys ¶ s ( R R
t Mappingt joint itemsR t mapR t _FormatParameterList( t testcase_params( ( sK /usr/lib/python2.7/site-packages/google/protobuf/internal/_parameterized.pyR ´ s t _ParameterizedTestIterc B s) e Z d Z d „ Z d „ Z d „ Z RS( s9 Callable and iterable class for producing new test cases.c C s | | _ | | _ | | _ d S( s\ Returns concrete test functions for a test and a list of parameters.
The naming_type is used to determine the name of the concrete
functions as reported by the unittest framework. If naming_type is
_FIRST_ARG, the testcases must be tuples, and the first element must
have a string representation that is a valid Python identifier.
Args:
test_method: The decorated test method.
testcases: (list of tuple/dict) A list of parameter
tuples/dicts for individual test invocations.
naming_type: The test naming type, either _NAMED or _ARGUMENT_REPR.
N( t _test_methodt testcasest _naming_type( t selft test_methodR t naming_type( ( sK /usr/lib/python2.7/site-packages/google/protobuf/internal/_parameterized.pyt __init__Á s c O s t d ƒ ‚ d S( Ns¹ You appear to be running a parameterized test case without having inherited from parameterized.ParameterizedTestCase. This is bad because none of your test cases are actually being run.( t RuntimeError( R t argst kwargs( ( sK /usr/lib/python2.7/site-packages/google/protobuf/internal/_parameterized.pyt __call__Ó s c s; | j ‰ | j ‰ ‡ ‡ f d † ‰ ‡ f d † | j Dƒ S( Nc sÙ t j ˆ ƒ ‡ ‡ f d † ƒ } ˆ t k r\ t | _ | j t ˆ d ƒ 7_ ˆ d ‰ n8 ˆ t k r d t ˆ ƒ f | _ n t
d ˆ f ƒ ‚ d | j t ˆ ƒ f | _ ˆ j rÕ | j d ˆ j f 7_ n | S( Nc sO t ˆ t j ƒ r" ˆ | ˆ n) t ˆ ƒ r> ˆ | ˆ Œ n
ˆ | ˆ ƒ d S( N( R R
R R ( R ( R R ( sK /usr/lib/python2.7/site-packages/google/protobuf/internal/_parameterized.pyt BoundParamTestÞ s
i i s (%s)s %s is not a valid naming type.s %s(%s)s
%s( t functoolst wrapst
_FIRST_ARGt Truet __x_use_name__R t strt _ARGUMENT_REPRR t __x_extra_id__R t __doc__( R R$ ( R R ( R sK /usr/lib/python2.7/site-packages/google/protobuf/internal/_parameterized.pyt MakeBoundParamTestÝ s !
c 3 s | ] } ˆ | ƒ Vq d S( N( ( R t c( R. ( sK /usr/lib/python2.7/site-packages/google/protobuf/internal/_parameterized.pys ü s ( R R R ( R ( ( R. R R sK /usr/lib/python2.7/site-packages/google/protobuf/internal/_parameterized.pyt __iter__Ù s ( R R R- R R# R0 ( ( ( sK /usr/lib/python2.7/site-packages/google/protobuf/internal/_parameterized.pyR ¾ s c C s$ t | ƒ d k o# t | d t ƒ S( s<