Skip to content

fenrrir/pyguice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Guice [http://code.google.com/p/google-guice/] for python 3k

class ImplHello:

    def say_hello(self):
        return "Hello World"


class MockHello:


    def say_hello(self):
        pass


@ImplementedBy(ImplHello)
class Hello:

    def say_hello(self):
        raise



class Test:

    @Inject
    def __init__(self, hello : Hello):
        self.hello = hello


    def run(self):
        return self.hello.say_hello()




t = Test()
assert t.run() == "Hello World"

Configuration('test').bind(Hello, MockHello).deploy()

t = Test()
assert t.run() == None



About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages