Esempio n. 1
0
    def test_nested(self):
        alice = Knowledge('alice ')
        bob = Knowledge()

        @bob.simple("about time")
        async def touch(message: str):
            assert message == 'about time'
            return 'time is nothing'

        alice.prefix('ask bob ', bob)  # make nested knowledge

        reply = asyncio.get_event_loop().run_until_complete(alice('alice ask bob about time'))
        print("reply", reply)
        assert reply == 'time is nothing', 'nested knowledge'