Ejemplo n.º 1
0
def run (autoTester):
    # Import without 'as'
    autoTester.check ('modules')
    autoTester.check (a.f ())
    autoTester.check (modules.mod1.mod11.mod112.f ())
    autoTester.check (modules.mod1.mod11.e)
    autoTester.check (pi)
    autoTester.check (f (102030))
    autoTester.check (modules.mod2.mod21.f ())
    B = modules.mod2.mod22.B
    b = B ()
    autoTester.check (b.x)
    autoTester.check (modules.mod3.x)
    
    # Import with 'as'
    a2 = aliasMod111.A (6789101112)
    autoTester.check (a2.f ())
    autoTester.check (aMod1.pi)
    
    # From ... import without 'as'
    a3 = mod111.A (100.001)
    autoTester.check (a3.f ())
    autoTester.check (mod112.f ())
    
    # From ... import with 'as'
    autoTester.check (aMod21.f ())
    autoTester.check (aMod22.B () .x)
    
    # From ... import *
    autoTester.check (mod3Hundred)
    autoTester.check (mod3GetTwoHundred ())
    autoTester.check (A (123.321) .f ())
Ejemplo n.º 2
0
def run(autoTester):
    # Import without 'as'
    autoTester.check('modules')
    autoTester.check(a.f())
    autoTester.check(modules.mod1.mod11.mod112.f())
    autoTester.check(modules.mod1.mod11.e)
    autoTester.check(pi)
    autoTester.check(f(102030))
    autoTester.check(modules.mod2.mod21.f())
    B = modules.mod2.mod22.B
    b = B()
    autoTester.check(b.x)
    autoTester.check(modules.mod3.x)

    # Import with 'as'
    a2 = aliasMod111.A(6789101112)
    autoTester.check(a2.f())
    autoTester.check(aMod1.pi)

    # From ... import without 'as'
    a3 = mod111.A(100.001)
    autoTester.check(a3.f())
    autoTester.check(mod112.f())

    # From ... import with 'as'
    autoTester.check(aMod21.f())
    autoTester.check(aMod22.B().x)

    # From ... import *
    autoTester.check(mod3Hundred)
    autoTester.check(mod3GetTwoHundred())
    autoTester.check(A(123.321).f())

    # Circular import (between mod4 and mod5)
    autoTester.check(mod4.mod4Add2FromMod5(449))
Ejemplo n.º 3
0
def run (autoTester):
    # Import without 'as'
    autoTester.check ('modules')
    autoTester.check (a.f ())
    autoTester.check (modules.mod1.mod11.mod112.f ())
    autoTester.check (modules.mod1.mod11.e)
    autoTester.check (pi)
    autoTester.check (f (102030))
    autoTester.check (modules.mod2.mod21.f ())
    B = modules.mod2.mod22.B
    b = B ()
    autoTester.check (b.x)
    autoTester.check (modules.mod3.x)
    
    # Import with 'as'
    a2 = aliasMod111.A (6789101112)
    autoTester.check (a2.f ())
    autoTester.check (aMod1.pi)
    
    # From ... import without 'as'
    a3 = mod111.A (100.001)
    autoTester.check (a3.f ())
    autoTester.check (mod112.f ())
    
    # From ... import with 'as'
    autoTester.check (aMod21.f ())
    autoTester.check (aMod22.B () .x)
    
    # From ... import *
    autoTester.check (mod3Hundred)
    autoTester.check (mod3GetTwoHundred ())
    autoTester.check (A (123.321) .f ())

    from modules import mod4
    # From ... import within function, with circular import
    autoTester.check(mod4.mod4Add2FromMod5(449))