
                         ~   d Z ddlmZ ddlZddlZddlZddlmZ ddlm	Z	 ddl
mZ ej                  j                  dk\  rddlmZ ej                   Zdd	lmZ dd
lmZ ee_        ej,                  Zd Zee_        edk(  r ed ej6                         z   ej8                          ee       d e_         ed ej6                         z   ej8                          ej:                           ej<                         j?                   e	j@                               Z! ejD                  e!jG                                 yy)zTTests for Dulwich.

This module is a stub that runs the builtin Dulwich test suite.
    )print_functionN)flags)tests)utils   )reload)git_test_util)
googletestc                       fd}|S )a  Alternate implementation of dulwich.tests.utils.ext_functest_builder.

  Dulwich skips extension tests for missing C extensions, but we need them in
  google3. This implementation fails fast if the C extensions are not found.

  Args:
    method: The method to run.
    func: The function implementation to pass to method.

  Returns:
    A test method to run the given C extension function.
  c                     | j                  t        t        j                        dj                  z          |        y )NzC extension for %s not found)
assertTrue
isinstancetypesBuiltinFunctionType__name__)selffuncmethods    'lib/third_party/dulwich/dulwich_test.pyDoTestz-NonSkippingExtFunctestBuilder.<locals>.DoTest2   s5    OOJtU%>%>?2T]]BD
4     )r   r   r   s   `` r   NonSkippingExtFunctestBuilderr   $   s    
 
-r   __main__z
ENCODING: )filec                       y)Nasciir   r   r   r   <lambda>r   B   s    gr   )$__doc__
__future__r   sysr   unittestabslr   dulwichr   dulwich.testsr   version_infomajor	importlibr   TestCase_real_testcasegoogle3.devtools.git.commonr	   google3.testing.pybaser
   FLAGSr   ext_functest_builderr   printgetfilesystemencodingstderr"ThisTestIsUsefulWithoutCallingMainTextTestRunnerrun
test_suiteresultexitwasSuccessfulr   r   r   <module>r9      s   & 
     Q "" ." 0 ;  z0s0022D+-#0s0022D/*//1"8""$(()9)9)9);<&
#((v##%%& r   