def test1(): """Test the SocketTalk peers.""" from SocketTalk import SocketTalk talk1, talk2 = SocketTalk.pair() talk1.put('one') assert talk2.get() == 'one' talk2.put('two') assert talk1.get() == 'two' talk2.close() assert talk1.get() is None talk1.close()
def server(): talk = SocketTalk.server(addr) assert talk.get() == 'one' talk.put('two') talk.close()
def client(): talk = SocketTalk.client(addr) talk.put('one') assert talk.get() == 'two' talk.close()