def test_clrtype_returns_existing_clr_types():
 global called
 if is_netstandard:
  clr.AddReference('System.Data.Common')
 else:
  clr.AddReference('System.Data')
 types = [System.Byte, System.Int16, System.UInt32, System.Int32, System.Int64, System.Double, System.Data.CommandType, System.Boolean, System.Char, System.Decimal, System.IntPtr, System.Object, System.String, System.Collections.BitArray, System.Collections.Generic.List[System.Char]]
 if (not is_netstandard):
  types.append(System.Data.Common.DataAdapter)
 for x in types:
  called = False
  class MyType(type, ):
   def __clrtype__(self):
    global called
    called = True
    return x
  class X(object, ):
   __metaclass__ = MyType
  AreEqual(called, True)

def test_clrtype_returns_existing_clr_types ( ) : global called if is_netstandard : clr . AddReference ( 'System.Data.Common' ) else : clr . AddReference ( 'System.Data' ) types = [ System . Byte , System . Int16 , System . UInt32 , System . Int32 , System . Int64 , System . Double , System . Data . CommandType , System . Boolean , System . Char , System . Decimal , System . IntPtr , System . Object , System . String , System . Collections . BitArray , System . Collections . Generic . List [ System . Char ] ] if ( not is_netstandard ) : types . append ( System . Data . Common . DataAdapter ) for x in types : called = False class MyType ( type , ) : def __clrtype__ ( self ) : global called called = True return x class X ( object , ) : __metaclass__ = MyType AreEqual ( called , True )
our implementation of __clrtype__ returns existing .