예제 #1
0
def start():
    print "######## Auger testing start"

    import error
    import license
    import log
    import preferences
    import version_manager
    import versions

    test_subjects = [
        error,
        log,
        preferences,
        version_manager,
        license,
        versions.v00001.install,
        versions.v00001.main,
        versions.v00001.process,
        versions.v00001.suspender,
        versions.v00001.utils,
    ]

    mock_subsitutes = {
        "genericpath": "os.path",
        "posixpath": "os.path",
    }

    global tester
    tester = auger.magic(test_subjects, mock_substitutes=mock_subsitutes)
    tester.__enter__()

    version_manager.main(done)
예제 #2
0
class Foo:  # Declare a class with a method
    def bar(self, x):
        return 2 * x


def test():
    foo = Foo()  # Create an instance of Foo
    print(foo.bar(32))  # Print 64


import auger
with auger.magic([Foo]):
    test()
예제 #3
0
import auger
from . import main, animal, pet
from . import foo
from . import properties
from . import functions

test_subjects = [animal, pet, foo.Foo, properties.Language, functions]

mock_sustitutes = {
    "genericpath": "os.path",
    "genericpath": "os.path",
}

extra_imports = [
    ('random', 'Random'),
]

with auger.magic(test_subjects,
                 mock_substitutes=mock_sustitutes,
                 extra_imports=extra_imports):
    main.main()
    foo.main()
    properties.main()
    functions.main()
예제 #4
0
import auger
from BitcoinComponent import BitcoinTransformer


def main():
    p = BitcoinTransformer()
    print(p)


with auger.magic([BitcoinTransformer]):
    main()
예제 #5
0
import auger
import main, animal, pet

with auger.magic([animal, pet]):
    main.main()

예제 #6
0
파일: main.py 프로젝트: adamdonahue/auger
import auger
from sample import animal, pet


def main():
    clifford = pet.create_pet('Clifford', 'Dog', 12)
    print('This dog is %d years old.' % clifford.get_age())
    print(clifford)


with auger.magic([pet, animal]):
    main()
예제 #7
0
파일: run.py 프로젝트: htrueman/test_dbis
import auger

import pet
import animal


def main():
    p = pet.create_pet("Polly", "Parrot")
    print(p, p.get_name(), p.get_species())


if __name__ == "__main__":
    with auger.magic([pet.Pet]):
        main()