示例#1
0
def test_emission_link():
    interface = TestInterface()
    generator = EmptyGenerator()
    mixer = AdditionMixer(generator)
    encryption = DummyEncryption()
    emitter = DummyEmitter()

    interface.output = mixer
    generator.output = mixer
    mixer.output = encryption
    encryption.output = emitter
示例#2
0
文件: webapp.py 项目: hoh/Vega
def main():
    interface = WebInterface()
    generator = EmptyGenerator()
    mixer = AdditionMixer()
    encryption = DummyEncryption()
    emitter = WebAppEmitter('http://localhost:8081/api')

    contacts = TestContacts()

    interface.output = mixer
    generator.output = mixer
    mixer.output = encryption
    encryption.output = emitter

    interface.contacts = contacts

    interface.run()
示例#3
0
def test_emission_flow():
    interface = TestInterface()
    generator = EmptyGenerator()
    mixer = AdditionMixer(generator)
    encryption = DummyEncryption()
    emitter = DummyEmitter()

    interface.output = mixer
    generator.output = mixer
    mixer.output = encryption
    encryption.output = emitter

    contacts = TestContacts()

    generator.gen()

    recipient = contacts['Bob']
    date = time.time()
    interface.send_message(recipient, 'Hello Bob !', date)